aboutsummaryrefslogtreecommitdiff
path: root/triangle.cpp
diff options
context:
space:
mode:
authorJack Sangdahl <[email protected]>2025-02-03 15:37:19 -0700
committerJack Sangdahl <[email protected]>2025-02-03 15:37:19 -0700
commit55a67f776dd9acd258cae16ffb636751666b0f40 (patch)
tree601539de43809b70ceb8228a12c35883fa300b03 /triangle.cpp
parenta0030873dabb517594ae0394350d6715071f7fb8 (diff)
downloadleetcode-55a67f776dd9acd258cae16ffb636751666b0f40.tar.gz
leetcode-55a67f776dd9acd258cae16ffb636751666b0f40.zip
chore: Remove incomplete solutions
Diffstat (limited to 'triangle.cpp')
-rw-r--r--triangle.cpp20
1 files changed, 0 insertions, 20 deletions
diff --git a/triangle.cpp b/triangle.cpp
deleted file mode 100644
index d7e826b..0000000
--- a/triangle.cpp
+++ /dev/null
@@ -1,20 +0,0 @@
-#include "leetcode.h"
-
-class Solution {
-public:
- int minimumTotal(vector<vector<int>> &triangle) {
- vector<int> ans(triangle.size(), triangle[0][0]);
- for (int i = 1; i < triangle.size(); i++)
- for (int j = i; j >= 0; j--) {
- if (j == 0)
- ans[0] += triangle[i][j];
- else if (j == i)
- ans[j] = triangle[i][j] + ans[j - 1];
- else
- ans[j] = triangle[i][j] + min(ans[j - 1], ans[j]);
- }
- return *min_element(ans.begin(), ans.end());
- }
-};
-
-int main() {}