1 00:00:01,620 --> 00:00:02,400 Hi, everyone. 2 00:00:02,430 --> 00:00:06,400 So in this video, we need to solve this question, Brent stepped into our often. 3 00:00:07,260 --> 00:00:11,960 So in the previous problem, we were just returning the number of steps through to the power minus one. 4 00:00:12,240 --> 00:00:15,630 But here in this problem, we need to bring the steps also. 5 00:00:15,920 --> 00:00:16,890 So it's very simple. 6 00:00:18,360 --> 00:00:19,810 You will do exactly the same thing. 7 00:00:19,830 --> 00:00:21,120 We will use that occasion. 8 00:00:23,740 --> 00:00:26,140 So using religion is very easy, but I will do so. 9 00:00:28,880 --> 00:00:34,250 I will call the function I will first of all, I will put this and minus one disc here. 10 00:00:35,210 --> 00:00:36,170 So this is souce. 11 00:00:36,500 --> 00:00:40,280 This is destination, sorry, this is Helper and this is destination. 12 00:00:40,700 --> 00:00:41,810 So I will call the function. 13 00:00:41,810 --> 00:00:42,770 I will call the collision. 14 00:00:44,300 --> 00:00:49,000 I will call you because you want to paint the steps for moving in minus one disc. 15 00:00:49,040 --> 00:00:52,640 So the question will do the work then I will do very small work so I will bring to this. 16 00:00:53,000 --> 00:00:55,310 So I will bring this a step. 17 00:00:55,790 --> 00:00:57,880 I will write the code for moving the disk. 18 00:00:58,130 --> 00:01:00,170 So I will write setout. 19 00:01:01,600 --> 00:01:02,440 Moving disc. 20 00:01:04,489 --> 00:01:07,780 The name of this name is and so moving this and. 21 00:01:09,050 --> 00:01:13,800 From here to see I can print this message, so I will do this myself. 22 00:01:14,390 --> 00:01:17,360 So these are my desk, so now I will call that equation. 23 00:01:18,890 --> 00:01:23,770 So now I will call dedication to the steps for moving this and minus one this symbol. 24 00:01:24,110 --> 00:01:29,620 So this small work, I will do these two large, evocative general symbol. 25 00:01:29,870 --> 00:01:32,870 So this is also a BNC source. 26 00:01:35,240 --> 00:01:36,140 Destination. 27 00:01:37,720 --> 00:01:38,260 Helper. 28 00:01:40,520 --> 00:01:41,540 So let's write the code. 29 00:01:44,280 --> 00:01:48,840 So this time I will not return anything I will bring to the steps, so avoid. 30 00:01:51,630 --> 00:01:57,060 So I'm going to print the steps, but I will take so I will take how many steps? 31 00:01:58,190 --> 00:02:06,260 I will take source, I will take what is my destination and I will take. 32 00:02:07,740 --> 00:02:08,280 Helper. 33 00:02:09,880 --> 00:02:11,080 And I will write the code. 34 00:02:12,920 --> 00:02:16,430 So basically, it's very simple if the value of an A zero. 35 00:02:17,530 --> 00:02:23,680 If there is no disc, I will not print anything I will done and now I will call the function. 36 00:02:24,790 --> 00:02:30,760 So let's call the function here, so let's copy the name Brent Steps. 37 00:02:32,880 --> 00:02:34,800 So let's call it a function Benke steps. 38 00:02:36,150 --> 00:02:38,550 With the sauce is the sauce. 39 00:02:40,270 --> 00:02:42,130 Destination is basically sea. 40 00:02:44,590 --> 00:02:46,330 And help is basically be. 41 00:02:48,650 --> 00:02:49,370 So remember. 42 00:02:55,290 --> 00:02:58,710 So basically, this is the source, so is the source. 43 00:03:02,170 --> 00:03:04,450 Bees basically helper, so bees helper. 44 00:03:06,510 --> 00:03:07,930 And see if their destination. 45 00:03:07,950 --> 00:03:10,640 OK, so C is their destination simple? 46 00:03:11,100 --> 00:03:14,270 So what I need to do is pull E has ended. 47 00:03:14,280 --> 00:03:19,710 OK, so first of all, I will call dedication to the steps for moving this and minus one disc. 48 00:03:20,400 --> 00:03:24,350 OK, so for moving this and minus one disc, this will act. 49 00:03:25,290 --> 00:03:29,140 This will act as a destination and this will act as a helper. 50 00:03:30,540 --> 00:03:37,900 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. 51 00:03:38,760 --> 00:03:43,040 So after moving all this, C basically will help us, OK. 52 00:03:43,070 --> 00:03:45,140 So you will see will act as a helper. 53 00:03:45,870 --> 00:03:47,100 So let's write the code. 54 00:03:51,610 --> 00:03:52,660 So Brent steps. 55 00:03:53,840 --> 00:03:55,760 I want to move and minus one desk. 56 00:03:57,130 --> 00:04:05,360 So so this is basically as their destination is basically be a destination is B, that means I need 57 00:04:05,360 --> 00:04:12,140 to give each and helper will be busy, so I will give the simple. 58 00:04:16,610 --> 00:04:17,690 So after doing this. 59 00:04:19,060 --> 00:04:24,700 So this step is done now, I will do very small work, so I will move this desk. 60 00:04:24,730 --> 00:04:27,290 So this is endless and minus one and minus two. 61 00:04:27,490 --> 00:04:28,900 And finally, this one. 62 00:04:29,200 --> 00:04:31,840 So I will move this desk from a. 63 00:04:33,120 --> 00:04:39,060 To see so is the source see is their destination, so let's write the code. 64 00:04:41,580 --> 00:04:42,240 Setout. 65 00:04:45,130 --> 00:04:46,030 Moving disc. 66 00:04:47,860 --> 00:04:49,210 I am moving disc and. 67 00:04:50,250 --> 00:04:51,450 So moving this an. 68 00:04:56,270 --> 00:05:01,280 From source to destination, so from source. 69 00:05:06,210 --> 00:05:06,960 Destination. 70 00:05:13,200 --> 00:05:19,790 So what I'm doing here is so I am printing the message, so I am printing this message, moving disk, 71 00:05:19,800 --> 00:05:29,070 and so this is a and from source sources, a destination destination, D.C. So moving this and from 72 00:05:29,070 --> 00:05:32,450 here to see somebody or basically what they can do. 73 00:05:32,460 --> 00:05:36,660 So instead of instead of writing to you can print this ad also. 74 00:05:38,180 --> 00:05:41,000 So after this work is done, now what I need to do. 75 00:05:42,460 --> 00:05:48,610 So the last step is remaining and what is the last step, so last step is moving this and minus one 76 00:05:48,610 --> 00:05:50,500 desk from here to here. 77 00:05:50,680 --> 00:05:52,930 So I will call dedication to the steps. 78 00:05:53,950 --> 00:06:02,200 For 10 minutes on this, so we will act as source, we will also see will act as a destination. 79 00:06:04,270 --> 00:06:06,010 And it will help Helper. 80 00:06:08,160 --> 00:06:16,260 Simply, I want to move this and minus one disc, so we will be the source, see will be their destination 81 00:06:16,410 --> 00:06:17,680 and it will be the helper. 82 00:06:18,180 --> 00:06:19,290 So let's write the code. 83 00:06:24,340 --> 00:06:25,480 So Brent steps. 84 00:06:28,070 --> 00:06:29,940 I want to move on minus one desk. 85 00:06:31,430 --> 00:06:32,750 So basically the source. 86 00:06:34,110 --> 00:06:38,230 Basically, the source is basically A helper, so B was a helper. 87 00:06:38,550 --> 00:06:42,480 So this is source now and I need to pass their destination. 88 00:06:42,480 --> 00:06:44,010 Destination is basically the. 89 00:06:45,590 --> 00:06:48,560 And I need to pass the personnel police source. 90 00:06:50,850 --> 00:06:52,590 And I think our function will work. 91 00:06:54,320 --> 00:06:56,480 OK, so I think our function will work. 92 00:06:59,700 --> 00:07:01,800 So let's say the value of ND is one. 93 00:07:03,670 --> 00:07:09,230 So the number of ways, number of steps is one, so you can see our output, I think is correct. 94 00:07:09,970 --> 00:07:11,230 So there is only one desk. 95 00:07:12,850 --> 00:07:20,290 This is A, this is B and the C, there's only one desk, so I have only one desk, so I am printing 96 00:07:20,290 --> 00:07:26,800 one, you can see, so I am printing the number of steps, so I'm printing one and here moving this 97 00:07:26,890 --> 00:07:30,250 one from E to C, so moving this one from me to see. 98 00:07:31,060 --> 00:07:31,920 So it is working. 99 00:07:32,320 --> 00:07:34,570 Let's give some big input allergy. 100 00:07:38,650 --> 00:07:40,120 So this time I will give to. 101 00:07:41,820 --> 00:07:46,070 Give to and let's try to see whether the output is right or wrong. 102 00:07:48,000 --> 00:07:49,620 So basically, this is a. 103 00:07:50,670 --> 00:08:02,150 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 104 00:08:02,160 --> 00:08:03,350 this I have to describe it. 105 00:08:03,990 --> 00:08:09,990 So moving this one from here to be so moved this disc from A to B, so this is their disc. 106 00:08:11,070 --> 00:08:19,740 So moving this from here to see so remove this crew and put it at sea when this one from B to C, so 107 00:08:19,740 --> 00:08:26,160 moving this one from B to C, so, yes, it is working and you can see the number of steps is basically 108 00:08:26,160 --> 00:08:26,460 three. 109 00:08:26,940 --> 00:08:28,490 So I think our function is correct. 110 00:08:28,860 --> 00:08:30,300 So let's take one more input. 111 00:08:30,900 --> 00:08:32,220 Let's check for three also. 112 00:08:33,460 --> 00:08:38,650 No, of this country, so two steps will be seven Solarte. 113 00:08:39,720 --> 00:08:41,070 Whether it is right or wrong. 114 00:08:45,620 --> 00:08:46,900 So I have three disc. 115 00:08:48,250 --> 00:08:48,970 Mascotry. 116 00:08:50,860 --> 00:08:52,270 Disc two and this one. 117 00:08:53,830 --> 00:08:59,830 So I have to ask, so steps one, two, three, four, five, six and seven, and I'm getting seven. 118 00:09:02,100 --> 00:09:05,550 So this is the helper bee and this is the destination Witkacy. 119 00:09:08,360 --> 00:09:15,020 So the first step is moving this one from May to see some of this one from E! 120 00:09:15,080 --> 00:09:16,700 So this was from me to see. 121 00:09:17,120 --> 00:09:26,570 So I am putting one here, OK, moving this two from here to be removed, disc two and put it on B so 122 00:09:26,570 --> 00:09:31,450 this is a disc to moving this one from C to be. 123 00:09:31,790 --> 00:09:32,950 So this is one. 124 00:09:33,710 --> 00:09:35,030 Put it here. 125 00:09:36,440 --> 00:09:44,570 Mesclun moving this country from here to see so removed from here and protected, so this is our desk 126 00:09:44,570 --> 00:09:44,900 three. 127 00:09:47,420 --> 00:09:54,980 Then Mesclun Betawi, so this one butoh so is currently empty, so this is one. 128 00:09:56,420 --> 00:10:02,900 OK, this is one moving this CK2 from B to C, so this to remove and put it on C. 129 00:10:05,270 --> 00:10:11,960 Moving this one from me to see, so remove one from here and put it here and we are done and we are 130 00:10:11,960 --> 00:10:14,780 done, so basically our function is working perfectly fine. 131 00:10:15,320 --> 00:10:16,730 So let's give a big input now. 132 00:10:19,580 --> 00:10:24,440 OK, so let's give a big value and let's see what the output, let's say the value is 10. 133 00:10:26,140 --> 00:10:28,690 So basically, the number of steps will be pretty. 134 00:10:33,640 --> 00:10:39,130 So the number of steps it will take is one zero to three, so it will take one zero two three steps 135 00:10:39,580 --> 00:10:40,360 to move 10. 136 00:10:41,560 --> 00:10:44,000 And let's give a big volume and let's see when it will stop. 137 00:10:44,650 --> 00:10:51,670 So I want to move 15 disc so this function will work. 138 00:10:51,820 --> 00:10:53,340 So how many steps it will print? 139 00:10:53,890 --> 00:10:56,230 So it will print to about 15 minutes. 140 00:10:56,230 --> 00:10:56,890 One steps. 141 00:10:58,730 --> 00:11:02,180 So this is a very big value and our function will take time. 142 00:11:02,630 --> 00:11:05,170 So if you want, you can wait, but I'm closing it. 143 00:11:06,080 --> 00:11:08,570 You can run the value 15 for your system. 144 00:11:11,410 --> 00:11:14,980 So this is it from this video, this function was very simple function. 145 00:11:15,850 --> 00:11:17,700 So this is it from this video. 146 00:11:17,710 --> 00:11:18,970 I will see you in the next one. 147 00:11:19,000 --> 00:11:19,510 Thank you.