nikunjsoni

334

Jun 28th, 2021
93
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class Solution {
  2. public:
  3.     bool increasingTriplet(vector<int>& nums) {
  4.         int first=INT_MAX, second=INT_MAX;
  5.         for(auto num: nums){
  6.             if(num<=first)
  7.                 first = num;
  8.             else if(num<=second)
  9.                 second = num;
  10.             else
  11.                 return true;
  12.         }
  13.         return false;
  14.     }
  15. };
RAW Paste Data