```
public class Solution {
public boolean increasingTriplet(int[] nums) {
int[] res = new int[3];
int len = 0;
for (int num : nums) {
if (len == 0 || num > res[len - 1]) {
res[len++] = num;
if (len == 3) return true;
}
else {
int i = 0;
while (res[i] < num) i++;
res[i] = num;
}
}
return false;
}
}
```