```
class Solution:
# @return a list of lists of integers
def combine(self, n, k):
combo = [[]]
for i in range(1, n+1):
new_list = [j[:] for j in combo if len(j) < k]
for j in new_list:
j.append(i)
combo.extend(new_list)
return [j for j in combo if len(j) == k]
```