Skip to content

Latest commit

 

History

History
executable file
·
25 lines (17 loc) · 422 Bytes

File metadata and controls

executable file
·
25 lines (17 loc) · 422 Bytes

题目

Given a collection of integers that might contain duplicates, nums, return all possible subsets.

Note: The solution set must not contain duplicate subsets.

For example, If nums = [1,2,2], a solution is:

[ [2], [1], [1,2,2], [2,2], [1,2], [] ]

解题思路

观察题目输出结果的规律后,利用dfs解题

见程序注释