美文网首页
334. Increasing Triplet Subseque

334. Increasing Triplet Subseque

作者: 夜皇雪 | 来源:发表于2016-12-14 04:04 被阅读0次
    public class Solution {
        public boolean increasingTriplet(int[] nums) {
            int min=Integer.MAX_VALUE,secondmin=Integer.MAX_VALUE;
            for(int num:nums){
                if(num<=min) min=num;
                else if(num<=secondmin) secondmin=num;
                else return true;
            }
            return false;
        }
    }
    

    相关文章

      网友评论

          本文标题:334. Increasing Triplet Subseque

          本文链接:https://www.haomeiwen.com/subject/ylfimttx.html