Skip to content

Added Python solution for 62. Unique Paths #118

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 15, 2022

Conversation

JoyKrishan
Copy link
Contributor

Added Python solution for 62. Unique Paths. #115

@@ -0,0 +1,12 @@
class Solution:
def uniquePaths(self, m: int, n: int) -> int:

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove unnecessary blank line

class Solution:
def uniquePaths(self, m: int, n: int) -> int:

bottomRow = [1]*n
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use snake case and also add spaces between operator and operand, for example: bottom_row = [1] * n

bottomRow = [1]*n

for column in range(m - 1):
newRow = [1]*n
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use snake case and also add spaces between operator and operand
also, add a blank line below this line


for column in range(m - 1):
newRow = [1]*n
for i in range(n-2, -1, -1):
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

n-2 should be n - 2

for column in range(m - 1):
newRow = [1]*n
for i in range(n-2, -1, -1):
newRow[i] = newRow[i + 1] + bottomRow[i]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use snake case

@Tahanima Tahanima merged commit 6aeabf0 into Tahanima:main Oct 15, 2022
@JoyKrishan JoyKrishan deleted the leetcode-62 branch June 29, 2023 11:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants