<prompt> Kujenga algorithm kwa ajili ya kutatua Mnara wa Hanoi tatizo.  <response>: The Tower of Hanoi is a classic puzzle game with a goal of moving a stack of disks from one peg to another with the following three constraints:1. Only one disk can be moved at a time.2. Each move consists of taking the upper disk from one peg and moving it to another peg.3. No disk may be placed on top of a smaller disk.Given these constraints, we can use a recursive algorithm to solve the Tower of Hanoi puzzle.Lets define the function towerOfHanoin, source, destination, auxiliary where n is the number of disks, source is the peg where the disks are initially stacked, destination is the peg where the disks need to be transferred to and auxiliary is the third peg that can be used as a temporary peg for moving the disks.1. If n 1, then move the top disk from source to destination peg.2. If n 1, then: a. Recursively call towerOfHanoin-1, source, auxiliary, destination to move the top n-1 disks from the source peg to the auxiliary peg using the destination peg as the temporary peg. b. Move the nth disk from the source peg to the destination peg. c. Recursively call towerOfHanoin-1, auxiliary, destination, source to move the n-1 disks from the auxiliary peg to the destination peg using the source peg as the temporary peg. Below is sample code for the algorithm in Python:def towerOfHanoin, source, destination, auxiliary: if n 1: printfMove disk 1 from source to destination else: towerOfHanoin-1, source, auxiliary, destination printfMove disk n from source to destination towerOfHanoin-1, auxiliary, destination, sourceWhen the function is called with the appropriate initial values, it will print out the step-by-step solution to the Tower of Hanoi puzzle. For example:towerOfHanoi3, A, B, COutput will be:Move disk 