My idea is to memorize the smallest middle number(a number which has a smaller number before it), so in the for loop, when current number is bigger than the smallest middle number before it, we find an increasing triplet.

```
bool increasingTriplet(vector<int>& nums) {
if (nums.size() < 3)return false;
int min = nums[0];
int middle = INT_MIN;
for (int i = 1; i < nums.size(); i++)
{
if (nums[i] <= min)min = nums[i];
else
{
if (middle == INT_MIN || middle >= nums[i])middle = nums[i];
else return true;
}
}
return false;
}
```