zoukankan      html  css  js  c++  java
  • [LeetCode] 101. 对称二叉树

    这个题真的是lc送给我们的儿童节礼物,简单的甜哈

    class Solution {
        public List<Boolean> kidsWithCandies(int[] candies, int extraCandies) {
            int max=candies[0];
            for(int i=1;i<candies.length;i++){
                if(candies[i]>=max){
                    max=candies[i];
                }
            }
    
            List<Boolean> res=new ArrayList<>();
            for(int i=0;i<candies.length;i++){
                if(candies[i]+extraCandies>=max){
                    res.add(true);
                }else{
                    res.add(false);
                }
            }
            return res;
        }
    }

  • 相关阅读:
    request相关
    C#请求接口
    qml_base
    web
    entry
    listbox
    Canvas
    pickle
    c#枚举
    数据结构——树
  • 原文地址:https://www.cnblogs.com/doyi111/p/13028134.html
Copyright © 2011-2022 走看看