Leetcode in Java && Oracle
422 subscribers
8 photos
397 files
400 links
Second channel: @codeforces_java

Let's Develop Together!
Download Telegram
#N1431 Kids With the Greatest Number of Candies
problem link=>https://leetcode.com/problems/kids-with-the-greatest-number-of-candies/

class Solution {
public List<Boolean> kidsWithCandies(int[] candies, int extra) {
ArrayList<Boolean> ans = new ArrayList<Boolean>();
int max=0;
for(int candy: candies){
max=Math.max(candy, max);
}
for(int candy: candies){
ans.add(candy+extra>=max);
}

return ans;
}
}