#14Team Formation Possibilities
Given an integer array players containing unique player IDs, generate all possible teams that can be formed from the available players. For each player, there are two choices: include the player in the team or leave the player out. This means the result should contain every possible combination, including the empty team, teams with a single player, teams with multiple players, and the team containing all players. Return all possible teams without duplicates, in any order.
Real-World Applications: Feature Selection in Machine Learning; Product Bundle Generation; Resource Combination Planning;
Examples
Example 1
Input: players = [4, 7]
Output: [[],[4],[7],[4,7]]
Explanation:
There are exactly 4 possible teams.
Example 2
Input: players = [10, 20, 30]
Output: [[],[10],[20],[30],[10,20],[10,30],[20,30],[10,20,30]]
Explanation:
There are 2³ = 8 possible teams.
Example 3
Input: players = [-5]
Output: [[], [-5]]
Explanation:
--
Constraints
- 1 <= players.length <= 12
- -100 <= players[i] <= 100
- All values in players are unique.