-
Notifications
You must be signed in to change notification settings - Fork 33
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
Conversation
@@ -0,0 +1,12 @@ | |||
class Solution: | |||
def uniquePaths(self, m: int, n: int) -> int: | |||
|
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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): |
There was a problem hiding this comment.
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] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use snake case
Added Python solution for 62. Unique Paths. #115