classSolution: defuniquePaths(self, m: int, n: int) -> int: if m == 1or n == 1: return1 length_y = m length_x = n count_map = [[0for _ inrange(length_x)] for _ inrange(length_y)] count_map[0][0] = 1 for y inrange(length_y): for x inrange(length_x): if y > 0: count_map[y][x] += count_map[y - 1][x] if x > 0: count_map[y][x] += count_map[y][x - 1] return count_map[-1][-1]