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