Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/codemistic/Data-Structures-and-Algorithms
/ f
Function
f
CSES/Intro/TowerH.cc:6–12 ·
view source on GitHub ↗
Source
from the content-addressed store, hash-verified
4
vector<pair<int,int>> ans;
5
6
void f(int n,int from,int to,int aux) {
7
if (n == 0) return;
8
cnt++;
9
f(n-1,from,aux,to);
10
ans.push_back({from,to});
11
f(n-1,aux,to,from);
12
}
13
14
int solve(int n) {
15
f(n,1,3,2);
Callers
1
solve
Function · 0.70
Calls
1
push_back
Method · 0.80
Tested by
no test coverage detected