1. Code

class Solution:
  def uniquePaths(self, m: int, n: int) -> int:
    map = [1 for i in range(m*n)]
    for i in range(n, m*n):
      if (i%n) != 0:
        map[i] = map[i-1] + map[i-n]  
    return map[-1]

2. Result

        Runtime : 24 ms(96.88%), Memory usage : 14.2 MB(85.96%)
        (Runtime can be different by a system even if it is a same code.)

Check out the my GitHub repo for more info on the code. If you have questions, you can leave a reply on this post.