Combinations
Given two integers n and k, return all possible combinations of k numbers out of 1 … n.
(列举 C_n^k 的所有组合)
Example:
1. 回溯法 / DFS
具体实现方法如下:
1 | class Solution: |
Given two integers n and k, return all possible combinations of k numbers out of 1 … n.
(列举 C_n^k 的所有组合)
Example:
具体实现方法如下:
1 | class Solution: |