Back to problems

Array and DFS with Backtracking

Algorithm · SoFi · Medium

Given an integer array nums, which can include repeated values, produce every distinct subset possible (its power set). Note: No subset may appear more than once in the returned collection. Example 1: Explanation: Although 3 occurs twice, each unique subset is listed only once. Example 2: Explanation: A one-element array has the empty subset and the subset containing that element. Constraints: 1 <= nums.length <= 10 -10 <= nums[i] <= 10 Example Explanation: The duplicate…

Checking your access…