Leetcode in Java && Oracle
424 subscribers
8 photos
397 files
400 links
Second channel: @codeforces_java

Let's Develop Together!
Download Telegram
image_2023-06-05_12-50-01.png
23.6 KB
Runtime3 msBeats49.59%
Memory131.8 MBBeats25.49%
#N334. Increasing Triplet Subsequence
problem link
#solution
class Solution {
public boolean increasingTriplet(int[] nums) {
int small = Integer.MAX_VALUE, mid = Integer.MAX_VALUE;
for(int n: nums){
if(n<=small) small = n;
else if(n<=mid) mid = n;
else return true;
}
return false;
}
}
2👍2