100天LeetCode每日一题(day4)

好简单。。不知道在考啥(哦,今天是儿童节,LeetCode有心了)

 

class Solution:

    def kidsWithCandies(self, candies: List[int], extraCandies: int) -> List[bool]:

 

        n=len(candies)

        List=[True for i in range(n)]

        m=max(candies)

        for i in range(n):

            if candies[i]+extraCandies<m:

                List[i]=False

        return List

 

相关文章:

  • 2021-08-11
  • 2022-12-23
  • 2021-08-13
  • 2022-01-04
  • 2021-08-14
  • 2022-12-23
  • 2021-11-22
  • 2022-01-01
猜你喜欢
  • 2021-07-19
  • 2021-09-05
  • 2021-10-02
  • 2021-05-16
  • 2021-11-28
  • 2021-06-22
相关资源
相似解决方案