Loading problem…
Move from the top-left to the bottom-right of grid using only right or down steps. Include the value of every visited cell, including both endpoints, in the path sum.
Return the number of paths whose sum is divisible by k. Different sequences of visited cells count separately. Return the count modulo 1000000007 and do not modify grid. A sum of zero is divisible by every positive k.
Example 1:
Example 2:
Example 3: