```
//AC - 4ms;
bool increasingTriplet(int* nums, int size)
{
int first = INT_MAX, second = INT_MAX;
for(int i = 0; i < size; i++)
{
if(nums[i] <= first) first = nums[i]; //the equal condition here is quite essential;
else if(nums[i] <= second) second = nums[i];
else return true;
}
return false;
}
//AC - 4ms;
bool increasingTriplet(int* nums, int size)
{
int first = INT_MAX, second = INT_MAX;
for(int i = 0; i < size; i++)
{
if(nums[i] > second) return true;
else if(nums[i]>first) second = nums[i]<second? nums[i]:second; //make it as small as possible;
else first = nums[i]; //make it as small as possible;
}
return false;
}
```