LeetCode – Subsets (Java)
Given a set of distinct integers, S, return all possible subsets. Note: 1) Elements in a subset must be in non-descending order. 2) The solution set must not contain duplicate subsets. For example, given S = [1,2,3], the method returns: [ [3], [1], [2], [1,2,3], [1,3], [2,3], [1,2], [] ] Thoughts Given a set S … Read more