Skip to content

Commit ce876a6

Browse files
committed
Modifying Simple Solution for Problem - 62 - Unique Paths
1 parent 966587d commit ce876a6

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Unique_Paths/SimpleSolution.py

+2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
#Output: 28
3232
class Solution:
3333
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.
3436
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
3537
for i in range(1, n): #Loop through n
3638
for j in range(1, m): #Loop through m

0 commit comments

Comments
 (0)