diff options
author | Jack Sangdahl <[email protected]> | 2025-06-27 12:23:02 -0600 |
---|---|---|
committer | Jack Sangdahl <[email protected]> | 2025-06-27 12:23:02 -0600 |
commit | a96b65cbfad7f62f3db6b2eab105e4e25c0414c5 (patch) | |
tree | e2a2b3f49f9fb741be81415266ac93e74cff42ec /other/out_of_bounds_paths.cpp | |
parent | 694ad5ed71edcb1deccab54b72d706b779918276 (diff) | |
download | leetcode-a96b65cbfad7f62f3db6b2eab105e4e25c0414c5.tar.gz leetcode-a96b65cbfad7f62f3db6b2eab105e4e25c0414c5.zip |
chore: remove old cpp and rust solutions
Diffstat (limited to 'other/out_of_bounds_paths.cpp')
-rw-r--r-- | other/out_of_bounds_paths.cpp | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/other/out_of_bounds_paths.cpp b/other/out_of_bounds_paths.cpp deleted file mode 100644 index af5ce3f..0000000 --- a/other/out_of_bounds_paths.cpp +++ /dev/null @@ -1,35 +0,0 @@ -#include "leetcode.h" - -class Solution { -public: - int findPaths(int m, int n, int maxMove, int startRow, int startColumn) { - if (!maxMove) - return 0; - vector<vector<int>> curr(m + 2, vector<int>(n + 2)); - vector<vector<int>> last(m + 2, vector<int>(n + 2)); - for (int i = 1; i <= m; i++) { - curr[i][1]++; - curr[i][n]++; - } - for (int j = 1; j <= n; j++) { - curr[1][j]++; - curr[m][j]++; - } - int ans = curr[startRow + 1][startColumn + 1]; - for (int d = 1; d < maxMove; d++) { - curr.swap(last); - for (int i = 1; i <= m; i++) - for (int j = 1; j <= n; j++) - curr[i][j] = (((long)last[i - 1][j] + last[i + 1][j] + - last[i][j - 1] + last[i][j + 1]) % - 1000000007L); - ans = (ans + curr[startRow + 1][startColumn + 1]) % 1000000007L; - } - return ans; - } -}; - -int main() { - Solution obj; - cout << obj.findPaths(2, 2, 2, 0, 0); -} |