title: Returning all the subsets. (Issue with recursion)
body: <pre><code>class Solution(object):
      lista=[]
      def subsets(self, nums):
          subset=[]
          i=0
          self.helper(nums,subset,i)
          return self.lista
      def helper(self,nums,subset,i):
          if(i==len(nums)):
              print(self.lista)
              self.lista.append(subset)
              print(subset)
              
              return 
  
          subset.append(nums[i])
          self.helper(nums,subset,i+1)
          subset.pop()
          self.helper(nums,subset,i+1)
              
              
  
          
          &quot;&quot;&quot;
          :type nums: List[int]
          :rtype: List[List[int]]
          &quot;&quot;&quot;
  </code></pre>
  <p>So the question is <a href="https://leetcode.com/problems/subsets/" rel="nofollow noreferrer">https://leetcode.com/problems/subsets/</a>
  Can someone help me understand where I am going wrong? My code only returns an empty list. I understand that the last call of the recursion returns nullset but my lista is declared globally and so whenever I append something in the base case of the recursion function, shouldn't it append to the existing global list?. So, should it not append that to the lista and work properly? Any help is appreciated.</p>