class Solution {
/**
* @param Integer[] $nums
* @return Boolean
*/
function increasingTriplet($nums) {
$second = max($nums);
$third = max($nums);
foreach($nums as $index => $num) {
if ($num <= $second) {
$second = $num;
} elseif ($num <= $third) {
$third = $num;
} else {
return true;
}
}
return false;
}
}