🧠 Before you code — what pattern fits?
There are n kids with candies. Given an array candies (candies[i] = candies of the i-th kid) and extraCandies, return a boolean array result where result[i] is true if, after giving the i-th kid all the extraCandies, they have the greatest number of candies among all kids.
([2,3,5,1,3], 3) → [true,true,true,false,true]
🎬 Video explanation · Engineering Digest
Your solution runs against 3 unit tests, including edge and large-value cases.
Loading...
Test console · 3 unit tests
Submit your code to run it against all 3 unit tests. Results appear here.
JavaScript, TypeScript & Python run sandboxed in your browser; other languages run on the execution server. Your code is saved locally as you type.