Tower Of Henoi
how to apprch notes notes
class Solution { count = 0;
toh(N, from, to, aux) { if (N == 1) { console.log(`move disk ${N} from rod ${from} to rod ${to}`); this.count++; } else { this.toh(N - 1, from, aux, to); console.log(`move disk ${N} from rod ${from} to rod ${to}`); this.toh(N - 1, aux, to, from); this.count++; }
return this.count; }}