Notice Period

Duplicate Sticker Bundles

medium

A print shop has a tray of sticker designs — and some designs appear multiple times. They want to list every distinct sticker bundle a customer could assemble, where bundles are distinct as multisets (two copies of design 1 is different from one copy, but which physical copy you grabbed doesn't matter).

Given a list stickers of integers that may contain duplicates, return all distinct subsets. No subset may appear twice in your answer.

Example 1
in stickers = [1, 2, 2]
out [[], [1], [2], [1,2], [2,2], [1,2,2]]
[1,2] appears once even though there are two ways to pick a 2.
Example 2
in stickers = [0]
out [[], [0]]
Constraints
  • · 1 <= len(stickers) <= 10
  • · -10 <= stickers[i] <= 10
similar problem on LeetCode ↗
solution.pyloading python…
test results
Hit ▶ Run to test your code against the visible cases.