"""

class Solution(object):

```
def combine(self, n, k):
nums=list(range(1,n+1))
return self.helper(nums,k)
def helper(self, nums,r):
if r==1:
return [[num] for num in nums]
if len(nums)==r:
return [nums]
output=[]
for index in range(len(nums)-r+1):
for remainder in self.helper(nums[index+1:],r-1):
output.append([nums[index]]+remainder)
return output
```