toppings are all distinct.
Return every distinct set of toppings you could pick, including the empty set and the set with all of them. A set is defined only by which toppings it contains, so the answer must not list the same set twice.
The sets may come in any order, and so may the codes inside each set.toppings=[4, 7] → [[], [7], [4], [4, 7]]
You can take nothing, only 4, only 7, or both, which makes four options.
toppings=[-1] → [[], [-1]]
A single topping gives two sets: the empty one and the topping on its own.
toppings=[3, 0, 9] → [[], [9], [0], [0, 9], [3], [3, 9], [3, 0], [3, 0, 9]]
Three toppings give 2³ = 8 sets, from empty to all three.
toppings.length ≤ 10toppings[i] ≤ 1000toppings are distincttoppings=[4, 7]
[[], [7], [4], [4, 7]]
Run checks the first 3 tests in your browser. Submit checks all 91 tests on the server, hidden ones included.