diff --git a/Python/increasing-subsequences.py b/Python/increasing-subsequences.py index 6639959bc..c546bf9d1 100644 --- a/Python/increasing-subsequences.py +++ b/Python/increasing-subsequences.py @@ -1,5 +1,5 @@ # Time: O(n * 2^n) -# Space: O(n^2) +# Space: O(n), longest possible path in tree, which is if all numbers are increasing. # Given an integer array, your task is # to find all the different possible increasing @@ -27,7 +27,7 @@ def findSubsequencesHelper(nums, pos, seq, result): lookup = set() for i in xrange(pos, len(nums)): if (not seq or nums[i] >= seq[-1]) and \ - nums[i] not in lookup: + nums[i] not in lookup: lookup.add(nums[i]) seq.append(nums[i]) findSubsequencesHelper(nums, i+1, seq, result)