players members, numbered from 1 to players. The coach needs a team of exactly size people.
Return every possible team. A team is just a set of players: [1, 3] and [3, 1] are the same team and must appear once in the answer. The teams, and the numbers inside each team, may be listed in any order.players=4, size=3 → [[1, 2, 3], [1, 2, 4], [1, 3, 4], [2, 3, 4]]
There are 4 ways to pick three out of four players: each time one player sits on the bench.
players=3, size=1 → [[1], [2], [3]]
A one-player team: one team per player.
players=2, size=2 → [[1, 2]]
players ≤ 20size ≤ playersplayers=4, size=3
[[1, 2, 3], [1, 2, 4], [1, 3, 4], [2, 3, 4]]
Run checks the first 3 tests in your browser. Submit checks all 39 tests on the server, hidden ones included.