Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Solution {
- public:
- bool increasingTriplet(vector<int>& nums) {
- int a=INT_MAX,b=INT_MAX;
- for(auto num:nums)
- {
- if(num<=a)
- {
- a=num;
- }
- else if(num<=b)
- {
- b=num;
- }
- else
- {
- return true;
- }
- }
- return false;
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement