You can do a static int counter = 0; And whenever you do System. out. println(“Move disc from “+a+” to “+b); in Han(…) you can add counter++; below that.
You can do a static int counter = 0; And whenever you do System. out. println(“Move disc from “+a+” to “+b); in Han(…) you can add counter++; below that.