Choose Without Order
Combinations answer the question: how many ways can you choose some items when the order does not matter? Given n and k, return C(n, k), the number of ways to choose k items from n. For example, choosing 2 people from 5 can be done in 10 ways.
Примеры
Ввод
5, 2Вывод
10Ввод
10, 5Вывод
252Ввод
50, 10Вывод
10272278170Нужно реализовать
def combination(n: int, k: int) -> int:
Теги
math
Entre para ver seu histórico de envios
EntrarEntre para usar o AI Mentor
EntrarTests12
Visible tests
Teste oculto 7
Teste oculto 8
Teste oculto 9
Teste oculto 10
Teste oculto 11
Teste oculto 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