def findSubsequences(self, nums):
"""
:type nums: List[int]
:rtype: List[List[int]]
"""
def dfs(nums, path, res):
if len(path) > 1:
res.append(path)
if len(nums) == 0: return
for i in range(len(nums)):
if i > 0 and nums[i] == nums[i1]: continue
if (len(path) > 0 and path[1] <= nums[i]) or len(path) == 0:
dfs(nums[i+1:], path+[nums[i]], res)
res = []
dfs(nums, [], res)
return res
What's the problem of my codes


@simonzhu91 Exactly! For this problem, I need to check all previous numbers handling duplicates not only just one. Using set also save time. Thank you!