We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 966587d commit ce876a6Copy full SHA for ce876a6
Unique_Paths/SimpleSolution.py
@@ -31,6 +31,8 @@
31
#Output: 28
32
class Solution:
33
def uniquePaths(self, m, n):
34
+ if m == 0 or n == 0: #Condition-check: If m and n is zero
35
+ return 0 #Return zero unique paths.
36
tmp = [[1 for j in range(m)] for i in range(n)] #Create a 2d matrix of m column and n row, also filling row and column value by 1
37
for i in range(1, n): #Loop through n
38
for j in range(1, m): #Loop through m
0 commit comments