MCPcopy Create free account
hub / github.com/Hsinha11/Leetcode-solutions / comb

Method comb

77-combinations/combinations.py:6–14  ·  view source on GitHub ↗
(i,n,k,l,c)

Source from the content-addressed store, hash-verified

4 l = []
5 c = []
6 def comb(i,n,k,l,c):
7 if len(c)==k:
8 l.append(c[:])
9 return
10 for j in range(i,n+1):
11 # if j not in c:
12 c.append(j)
13 comb(j+1,n,k,l,c)
14 c.pop(-1)
15 i=1
16 comb(i,n,k,l,c)
17 return l

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected