Ctrl K
Problem

Every Topping Combo

Medium · Every Topping Combo

A coffee shop lets you add any toppings from a list to your drink. Each topping is identified by an integer code, and the codes in the array `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.…

Solve the problem →