FunctionRacerProblemsRace

Kids With the Most Candies

BeginnerArraysPython, JavaScript, TypeScript, Java, C++

Kid i has candies[i] candies, where candies is the first argument. You have extra more candies to give to one kid.

Return a list of booleans: item i is True if giving all extra candies to kid i would leave that kid with at least as many candies as every other kid, otherwise False. Each answer is considered separately.

Example 1

candies [2,3,5,1,3]
extra 3
returns [true,true,true,false,true]

The most any kid has is 5. Kid 0 would have 5 (True), kid 3 would have 4 (False).

Constraints

Race itor take your time

Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.

More Arrays problems