aboutsummaryrefslogtreecommitdiff
path: root/min_path_sum.cpp
diff options
context:
space:
mode:
authorJack Sangdahl <[email protected]>2025-01-29 11:46:16 -0700
committerJack Sangdahl <[email protected]>2025-01-29 11:46:16 -0700
commit2de9d2dce0fd4de524961ad5188a95410f4432c2 (patch)
tree0da068bf95592f39f2dd4f135b0e73b689df27d0 /min_path_sum.cpp
parentad25ada54a68851b935f52f9d1bc4ec969583205 (diff)
downloadleetcode-2de9d2dce0fd4de524961ad5188a95410f4432c2.tar.gz
leetcode-2de9d2dce0fd4de524961ad5188a95410f4432c2.zip
chore: Fix vvd usages
Diffstat (limited to 'min_path_sum.cpp')
-rw-r--r--min_path_sum.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/min_path_sum.cpp b/min_path_sum.cpp
index 2240f59..46c2ff1 100644
--- a/min_path_sum.cpp
+++ b/min_path_sum.cpp
@@ -6,9 +6,9 @@
class Solution {
public:
- int minPathSum(vvd(int) & grid) {
+ int minPathSum(vvd & grid) {
int m = grid.size(), n = grid[0].size();
- vvd(int) sum(m, vector<int>(n, grid[0][0]));
+ vvd sum(m, vector<int>(n, grid[0][0]));
for (int i = 1; i < m; i++)
sum[i][0] = sum[i - 1][0] + grid[i][0];
for (int j = 1; j < n; j++)
@@ -22,8 +22,8 @@ public:
int main() {
Solution obj;
- vvd(int) g1 = {{1, 3, 1}, {1, 5, 1}, {4, 2, 1}};
- vvd(int) g2 = {{1, 2, 3}, {4, 5, 6}};
+ vvd g1 = {{1, 3, 1}, {1, 5, 1}, {4, 2, 1}};
+ vvd g2 = {{1, 2, 3}, {4, 5, 6}};
printf("%d\n", obj.minPathSum(g1)); // expect: 7
printf("%d\n", obj.minPathSum(g2)); // expect: 12
}