Skip to content

Commit 3676d9c

Browse files
authored
Update out-of-boundary-paths.cpp
1 parent 9e0b449 commit 3676d9c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

C++/out-of-boundary-paths.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33

44
class Solution {
55
public:
6-
int findPaths(int m, int n, int N, int i, int j) {
6+
int findPaths(int m, int n, int N, int x, int y) {
77
const auto M = 1000000000 + 7;
88
vector<vector<vector<int>>> dp(2, vector<vector<int>>(m, vector<int>(n)));
9+
int result = 0;
910
for (int moves = 0; moves < N; ++moves) {
1011
for (int i = 0; i < m; ++i) {
1112
for (int j = 0; j < n; ++j) {
@@ -16,6 +17,6 @@ class Solution {
1617
}
1718
}
1819
}
19-
return dp[N % 2][i][j];
20+
return dp[N % 2][x][y];
2021
}
2122
};

0 commit comments

Comments
 (0)