There is a two-dimensional grid at most 15x15. Each space has an integer value between 0 and 65535, inclusive.
A path is a sequence of two or more spaces for which each space is horizontally or vertically adjacent to the previous space.
An increasing path is a path in which each space has a greater value than the previous space.
Below is an example of an increasing path:

Write a program to determine the number of increasing paths in a grid. Paths whose spaces have the same value but different locations are distinct.
There are at most 2,000 increasing paths in the grid.
Example 1:
Input: grid = [[5], [1], [2, 7]]
Output: 4
Explanation:![]()
There are 4 increasing paths. Those paths are:
1 β 5
1 β 7
2 β 5
2 β 7
π₯

input:
output: