Candy Leader Check

Imagine giving all the extra candies to each child one at a time and checking whether they would become a leader. Given a list candies, where each value is one child’s candy count, and a number extra_candies, return a list of booleans. For each child, return True if adding all extra candies would give them at least as many candies as any child has now.

Примеры

Ввод
[2, 3, 5, 1, 3], 3
Вывод
[True, True, True, False, True]
Ввод
[4, 2, 1, 1, 2], 1
Вывод
[True, False, False, False, False]
Ввод
[12, 1, 12], 10
Вывод
[True, False, True]

Нужно реализовать

def kids_with_candies(candies: list[int], extra_candies: int) -> list[bool]:

Теги

array
PostgreSQLv16

Koodin suorituksen tulos näkyy tässä

Tests12
Visible tests
Piilotettu testi 7
Piilotettu testi 8
Piilotettu testi 9
Piilotettu testi 10
Piilotettu testi 11
Piilotettu testi 12

They run when you press "Submit" — your whole solution is checked against them so you can't hard-code answers for the visible cases.

Focus radio
Paused · SomaFM · Fluid