You are given two integers n and m representing the dimensions of a k and two arrays source and dest, each of length source is the starting cell and dest is the destination cell.
At each step, you can move from the current cell to any other cell that is located in the same row or the same column as the current cell.
Return the total number of distinct paths to reach dest from source in exactly k steps. Since the answer may be large, return it modulo
Constraints:
n, m
k
source.length dest.length
source[0], dest[0] n
source[1], dest[1] m
You are given two integers n and m representing the dimensions of a k and two arrays source and dest, each of length source is the starting cell and dest is the destination cell.
At each step, you can move from the current cell to any other cell that is located in the same row or the same column as the current cell.
Return the total number of distinct paths to reach dest from source in exactly k steps. Since the answer may be large, return it modulo
Constraints:
n, m
k
source.length dest.length
source[0], dest[0] n
source[1], dest[1] m