From a96b65cbfad7f62f3db6b2eab105e4e25c0414c5 Mon Sep 17 00:00:00 2001 From: Jack Sangdahl Date: Fri, 27 Jun 2025 12:23:02 -0600 Subject: chore: remove old cpp and rust solutions --- other/132_pattern.cpp | 32 -------------------------------- 1 file changed, 32 deletions(-) delete mode 100644 other/132_pattern.cpp (limited to 'other/132_pattern.cpp') diff --git a/other/132_pattern.cpp b/other/132_pattern.cpp deleted file mode 100644 index a9f0c43..0000000 --- a/other/132_pattern.cpp +++ /dev/null @@ -1,32 +0,0 @@ -#include "leetcode.h" - -class Solution { -public: - bool find132pattern(vector &nums) { - int n = nums.size(), minI[n]; - stack s; - minI[0] = nums[0]; - for (int i = 1; i < nums.size(); i++) - minI[i] = min(minI[i - 1], nums[i]); - for (int i = nums.size() - 1; i >= 0; i--) { - while (!s.empty() && s.top() <= minI[i]) - s.pop(); - if (!s.empty() && s.top() < nums[i]) - return true; - s.push(nums[i]); - } - return false; - } -}; - -int main() { - vector nums = {1, 3, 2, 4}; - Solution obj; - for (int i = 0; i < nums.size(); i++) - cout << nums[i] << ' '; - cout << endl << "searching for '132'...\n"; - if (obj.find132pattern(nums)) - cout << "found"; - else - cout << "not found"; -} -- cgit v1.2.3