From 55a67f776dd9acd258cae16ffb636751666b0f40 Mon Sep 17 00:00:00 2001 From: Jack Sangdahl Date: Mon, 3 Feb 2025 15:37:19 -0700 Subject: chore: Remove incomplete solutions --- triangle.cpp | 20 -------------------- 1 file changed, 20 deletions(-) delete mode 100644 triangle.cpp (limited to 'triangle.cpp') 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> &triangle) { - vector 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() {} -- cgit v1.2.3