Skip to content

Commit 32fc253

Browse files
committed
Runtime: 355 ms (Top 76.39%) | Memory: 43.3 MB (Top 89.82%)
1 parent ebf5415 commit 32fc253

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

scripts/algorithms/N/Number of Increasing Paths in a Grid/Number of Increasing Paths in a Grid.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Runtime: 355 ms (Top 76.39%) | Memory: 43.3 MB (Top 89.82%)
12
class Solution {
23
public:
34
int mod = 1000000007;
@@ -20,7 +21,7 @@ class Solution {
2021
}
2122
int dfs(int x, int y, vector <vector<int>>&grid,vector <vector<int>>&dp){
2223
if(dp[x][y]!=-1) return dp[x][y];
23-
24+
2425
int ans = 1;
2526
for(int i = 0; i<4; i++){
2627
if(isvalid(x+dx[i],y+dy[i],grid) and grid[x][y]>grid[x+dx[i]][y+dy[i]]){
@@ -29,4 +30,4 @@ class Solution {
2930
}
3031
return dp[x][y] = ans%mod;
3132
}
32-
};
33+
};

0 commit comments

Comments
 (0)