Given an integer array nums that may contain duplicates, return all possible subsets (the power set). The solution set must not contain duplicate subsets. Return the solution in any order.
nums = [1,2,2][[],[1],[1,2],[1,2,2],[2],[2,2]]nums = [0][[],[0]]Sort brings duplicates together. The skip condition i>start && nums[i]==nums[i-1] prevents choosing the same value twice at the same recursion depth, avoiding duplicate subsets while still allowing the same value at different depths (e.g., [2] and [2,2] are both valid when there are two 2s).