pass 211 77 433
This commit is contained in:
		
							
								
								
									
										13
									
								
								77-240602-pass/main.py
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								77-240602-pass/main.py
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,13 @@ | ||||
| class Solution: | ||||
|     def combine(self, n: int, k: int) -> List[List[int]]: | ||||
|         rlt = [] | ||||
|         def comb(l, cur, k): | ||||
|             if k == 0:  | ||||
|                 rlt.append(l)  | ||||
|                 return | ||||
|             for i in range(cur, n + 1): | ||||
|                 tmp_l = l.copy() | ||||
|                 tmp_l.append(i) | ||||
|                 comb(tmp_l, i + 1, k - 1) | ||||
|         comb([], 1, k) | ||||
|         return rlt | ||||
		Reference in New Issue
	
	Block a user