No older revisions available
No older revisions available
~cpp #include <iostream> using namespace std; int num(int val, int start, int end); int main() { cout << num(3, 1, 2) << endl; return 0; } int num(int val, int start, int end) { if(val == 1) { cout << start << "->" << end << endl; return 1; } else { return num(val - 1, start, 6-start-end) + num(1,start,end) + num(val - 1, 6-start-end, end); } }