input: Write a function to find the number of unique paths from a given source to a destination in an m by n grid. The function should return the number of unique paths from the top-left corner to the bottom-right corner of the grid, considering only right and down moves are allowed. If the grid dimensions are 0 or any of them is less than 0, return 0.
  assert num_unique_paths(3, 2) == 3
  assert num_unique_paths(2, 3) == 3
  assert num_unique_paths(7, 3) == 28
  assert num_unique_paths(5, 5) == 70
  assert num_unique_paths(0, 5) == 0
  assert num_unique_paths(5, 0) == 0
output: def num_unique_paths(m, n):
      if m <= 0 or n <= 0:
          return 0
      dp = [[0] * n for _ in range(m)]
      for i in range(m):
          dp[i][0] = 1
      for j in range(n):
          dp[0][j] = 1
      for i in range(1, m):
          for j in range(1, n):
              dp[i][j] = dp[i-1][j] + dp[i][j-1]
      return dp[m-1][n-1]