class Solution { public: bool increasingTriplet(vector<int>& nums) { //使用双指针; int len=nums.size(); if(len<2) return false; int first=INT_MAX,second=INT_MAX; for(auto n: nums){ if(n<=first) first=n; else if(n<=second) second=n; else return true; } return false; } };