Tap here to switch tabs
Problem
Submissions

Problem: Kids With the Greatest Number of Candies

Try to solve the Kids With the Greatest Number of Candies problem.

Statement

Given an integer array candies of length n, where candies[i] represents the number of candies the ithi^{th} kid currently has, and an integer extraCandies, determine whether each kid can have the greatest number of candies after receiving all extraCandies.

Return a boolean array result of length n, where result[i] is TRUE if the ithi^{th} kid can have the greatest number of candies after receiving all extraCandies, and FALSE otherwise.

Note: Multiple kids can have the greatest number of candies at the same time.

Constraints:

  • n == candies.length

  • 2≤2 \leq n ≤102\leq 10^2

  • 1≤1 \leq candies[i] ≤102\leq 10^2

  • 1≤1 \leq extraCandies ≤50\leq 50

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Kids With the Greatest Number of Candies

Try to solve the Kids With the Greatest Number of Candies problem.

Statement

Given an integer array candies of length n, where candies[i] represents the number of candies the ithi^{th} kid currently has, and an integer extraCandies, determine whether each kid can have the greatest number of candies after receiving all extraCandies.

Return a boolean array result of length n, where result[i] is TRUE if the ithi^{th} kid can have the greatest number of candies after receiving all extraCandies, and FALSE otherwise.

Note: Multiple kids can have the greatest number of candies at the same time.

Constraints:

  • n == candies.length

  • 2≤2 \leq n ≤102\leq 10^2

  • 1≤1 \leq candies[i] ≤102\leq 10^2

  • 1≤1 \leq extraCandies ≤50\leq 50