返回首页
子集
LeetCode Hot 100
回溯
难度:
中等
题目描述
给定一个数组,返回所有可能的子集(幂集)。
解题思路
使用回溯法,每次选择是否包含当前元素,递归生成子集。时间复杂度为 O(2^n)。