Java clean solution


  • 0
    X
    public boolean increasingTriplet(int[] nums) {
            int min = Integer.MAX_VALUE;
            int smin = Integer.MAX_VALUE;
            
            for (int num : nums)
            {
                if (num > min && num > smin)
                    return true;
                
                if (num <= min)
                    min = num;
                else if (num < smin)
                    smin = num;
            }
            
            return false;
        }

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.