MCPcopy Create free account
hub / github.com/Ainevsia/Leetcode-Rust / recur

Method recur

77. Combinations/Solution.cpp:17–28  ·  view source on GitHub ↗

recur

Source from the content-addressed store, hash-verified

15 }
16//recur
17 void recur(int n, int k, vector<vector<int>> & v, vector<int> & buf) {
18 if ( k == 0 ) {
19 v.push_back(buf);
20 return;
21 } else {
22 for (int i=k; i<=n; i++) {
23 buf.push_back(i);
24 this->recur(i-1, k-1, v, buf);
25 buf.pop_back();
26 }
27 }
28 }
29};
30
31int main() {

Callers 1

combineMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected