Skip to content

Files

Latest commit

aQuaaQua
aQua
and
aQua
Sep 14, 2017
f5599f5 · Sep 14, 2017

History

History

0078.subsets

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Aug 24, 2017
Sep 14, 2017
Aug 24, 2017

题目

Given a set of distinct integers, nums, return all possible subsets.

Note: The solution set must not contain duplicate subsets.

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

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

解题思路

run一下,观察输出结果的队形。再用递归的方式解题。

见程序注释