Python simple code O(A*B)


#1

class Solution:
# @param A : integer
# @param B : integer
# @return an integer
def uniquePaths(self, A, B):
if(A==1):
return 1
Ans=[1]*B
for i in range(1,A):
for j in range(1,B):
Ans[j]+=Ans[j-1]
return Ans[-1]