Hi, everyone.
So in this video, we need to solve this question, Brent stepped into our often.
So in the previous problem, we were just returning the number of steps through to the power minus one.
But here in this problem, we need to bring the steps also.
So it's very simple.
You will do exactly the same thing.
We will use that occasion.
So using religion is very easy, but I will do so.
I will call the function I will first of all, I will put this and minus one disc here.
So this is souce.
This is destination, sorry, this is Helper and this is destination.
So I will call the function.
I will call the collision.
I will call you because you want to paint the steps for moving in minus one disc.
So the question will do the work then I will do very small work so I will bring to this.
So I will bring this a step.
I will write the code for moving the disk.
So I will write setout.
Moving disc.
The name of this name is and so moving this and.
From here to see I can print this message, so I will do this myself.
So these are my desk, so now I will call that equation.
So now I will call dedication to the steps for moving this and minus one this symbol.
So this small work, I will do these two large, evocative general symbol.
So this is also a BNC source.
Destination.
Helper.
So let's write the code.
So this time I will not return anything I will bring to the steps, so avoid.
So I'm going to print the steps, but I will take so I will take how many steps?
I will take source, I will take what is my destination and I will take.
Helper.
And I will write the code.
So basically, it's very simple if the value of an A zero.
If there is no disc, I will not print anything I will done and now I will call the function.
So let's call the function here, so let's copy the name Brent Steps.
So let's call it a function Benke steps.
With the sauce is the sauce.
Destination is basically sea.
And help is basically be.
So remember.
So basically, this is the source, so is the source.
Bees basically helper, so bees helper.
And see if their destination.
OK, so C is their destination simple?
So what I need to do is pull E has ended.
OK, so first of all, I will call dedication to the steps for moving this and minus one disc.
OK, so for moving this and minus one disc, this will act.
This will act as a destination and this will act as a helper.
So my aim is to move this and minus one disc from A to B, so it will be source B will be a destination.
So after moving all this, C basically will help us, OK.
So you will see will act as a helper.
So let's write the code.
So Brent steps.
I want to move and minus one desk.
So so this is basically as their destination is basically be a destination is B, that means I need
to give each and helper will be busy, so I will give the simple.
So after doing this.
So this step is done now, I will do very small work, so I will move this desk.
So this is endless and minus one and minus two.
And finally, this one.
So I will move this desk from a.
To see so is the source see is their destination, so let's write the code.
Setout.
Moving disc.
I am moving disc and.
So moving this an.
From source to destination, so from source.
Destination.
So what I'm doing here is so I am printing the message, so I am printing this message, moving disk,
and so this is a and from source sources, a destination destination, D.C. So moving this and from
here to see somebody or basically what they can do.
So instead of instead of writing to you can print this ad also.
So after this work is done, now what I need to do.
So the last step is remaining and what is the last step, so last step is moving this and minus one
desk from here to here.
So I will call dedication to the steps.
For 10 minutes on this, so we will act as source, we will also see will act as a destination.
And it will help Helper.
Simply, I want to move this and minus one disc, so we will be the source, see will be their destination
and it will be the helper.
So let's write the code.
So Brent steps.
I want to move on minus one desk.
So basically the source.
Basically, the source is basically A helper, so B was a helper.
So this is source now and I need to pass their destination.
Destination is basically the.
And I need to pass the personnel police source.
And I think our function will work.
OK, so I think our function will work.
So let's say the value of ND is one.
So the number of ways, number of steps is one, so you can see our output, I think is correct.
So there is only one desk.
This is A, this is B and the C, there's only one desk, so I have only one desk, so I am printing
one, you can see, so I am printing the number of steps, so I'm printing one and here moving this
one from E to C, so moving this one from me to see.
So it is working.
Let's give some big input allergy.
So this time I will give to.
Give to and let's try to see whether the output is right or wrong.
So basically, this is a.
This is B, this is C, so it is I will take three steps and I have so this is two and this is one to
this I have to describe it.
So moving this one from here to be so moved this disc from A to B, so this is their disc.
So moving this from here to see so remove this crew and put it at sea when this one from B to C, so
moving this one from B to C, so, yes, it is working and you can see the number of steps is basically
three.
So I think our function is correct.
So let's take one more input.
Let's check for three also.
No, of this country, so two steps will be seven Solarte.
Whether it is right or wrong.
So I have three disc.
Mascotry.
Disc two and this one.
So I have to ask, so steps one, two, three, four, five, six and seven, and I'm getting seven.
So this is the helper bee and this is the destination Witkacy.
So the first step is moving this one from May to see some of this one from E!
So this was from me to see.
So I am putting one here, OK, moving this two from here to be removed, disc two and put it on B so
this is a disc to moving this one from C to be.
So this is one.
Put it here.
Mesclun moving this country from here to see so removed from here and protected, so this is our desk
three.
Then Mesclun Betawi, so this one butoh so is currently empty, so this is one.
OK, this is one moving this CK2 from B to C, so this to remove and put it on C.
Moving this one from me to see, so remove one from here and put it here and we are done and we are
done, so basically our function is working perfectly fine.
So let's give a big input now.
OK, so let's give a big value and let's see what the output, let's say the value is 10.
So basically, the number of steps will be pretty.
So the number of steps it will take is one zero to three, so it will take one zero two three steps
to move 10.
And let's give a big volume and let's see when it will stop.
So I want to move 15 disc so this function will work.
So how many steps it will print?
So it will print to about 15 minutes.
One steps.
So this is a very big value and our function will take time.
So if you want, you can wait, but I'm closing it.
You can run the value 15 for your system.
So this is it from this video, this function was very simple function.
So this is it from this video.
I will see you in the next one.
Thank you.