class Solution {
public:
bool increasingTriplet(vector<int>& nums) {
int c1=INT_MAX;
int c2=INT_MAX;
for(int n:nums)
{
if(n<=c1)
c1=n;
else if(n<=c2)
c2=n;
else
return true;
}
return false;
}
};
334. Increasing Triplet Subsequence
最新推荐文章于 2017-03-11 22:57:28 发布