Golang solution


  • 0
    R
    func increasingTriplet(nums []int) bool {
        min := 1<<31 - 1
        sMin := 1<<31 - 1
        for _, num:= range nums {
            if num <= min { min = num 
            } else if num <= sMin { sMin = num 
            } else { return true }
        }
        return false
    }
    
    

Log in to reply
 

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