aboutsummaryrefslogtreecommitdiff
path: root/other/increasing_triplet_subsequence.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'other/increasing_triplet_subsequence.cpp')
-rw-r--r--other/increasing_triplet_subsequence.cpp26
1 files changed, 0 insertions, 26 deletions
diff --git a/other/increasing_triplet_subsequence.cpp b/other/increasing_triplet_subsequence.cpp
deleted file mode 100644
index 41a9f0e..0000000
--- a/other/increasing_triplet_subsequence.cpp
+++ /dev/null
@@ -1,26 +0,0 @@
-#include "leetcode.h"
-
-class Solution {
-public:
- bool increasingTriplet(vector<int> &nums) {
- int one = INT_MAX, two = INT_MAX;
- for (auto n : nums) {
- if (n <= one)
- one = n;
- else if (n <= two)
- two = n;
- else
- return true;
- }
- return false;
- }
-};
-
-int main() {
- Solution obj;
- vector<int> nums = {1, 2, 3, 4, 5};
- if (obj.increasingTriplet(nums))
- cout << "true";
- else
- cout << "false";
-}