leetcode5 [Easy][Python] Kids With the Greatest Number of Candies 총 n명의 아이들이 candies를 가지고 있다고 가정할때, 이는 candies라는 array형태로 저장되어있다. candies[i]는 ith 아이의 candies 갯수를 의미하며 extraCandies 라는 integer 변수가 주어진다. 이 문제는 boolean array인 result를 return해야하며 result[i]는 ith kid에게 extracandies 를 전부 주고 난 뒤에 그 사탕 갯수가 나머지 갯수중에 max candies일때 true를 가지고 그렇지 않으면 false를 가진다. 여러 아이들이 max 캔디 갯수를 가질 수 있다. 코드는 아래와 같다. class Solution: def kidsWithCandies(self, candies: List[int], extraCandies.. 2022. 10. 21. 이전 1 2 다음