class Solution:
def combinationSum3(self, k: int, n: int) -> List[List[int]]:
res = []
def help(tmp,i):
if sum(tmp)==n and len(tmp)==k:
res.append(tmp)
return
if sum(tmp)!=n and len(tmp)==k:
return
if sum(tmp)>n:
return
for j in range(i+1, 10):
help(tmp+[j],j)
help([],0)
return res