#include <iostream>
using namespace std;
// A to C using B
void TOH(int n, char A, char B, char C)
{
if(n==0) {
return;
}
TOH(n-1, A, C,B);
cout << A << " to " << C<< endl;
TOH(n-1, B, A,C);
}
int main()
{
TOH(3, 'A', 'B', 'C');
return 0;
}
class Solution { public int removeDuplicates ( int [] nums ) { // base case: return if array have no el. if ( nums...
No comments:
Post a Comment