1 00:00:00,960 --> 00:00:01,650 Hi, everyone. 2 00:00:01,680 --> 00:00:05,040 So in this video, we're going to solve this question, Woodgate Matrix. 3 00:00:06,030 --> 00:00:12,990 OK, so basically the government is basically engross and ammunition and what we have to do, so we 4 00:00:12,990 --> 00:00:17,310 have to rotate this matrix by 90 degrees in the clockwise direction. 5 00:00:17,870 --> 00:00:22,640 OK, so this is the clockwise direction and this is anticlockwise direction. 6 00:00:22,680 --> 00:00:28,860 OK, so basically we have to rotate the government by 90 degrees in the clockwise direction. 7 00:00:28,920 --> 00:00:31,270 OK, so let us consider some example. 8 00:00:31,740 --> 00:00:33,540 So let us consider this matrix. 9 00:00:33,700 --> 00:00:37,560 OK, so now that is rotated by 90 degree in the clockwise direction. 10 00:00:37,610 --> 00:00:39,840 OK, so initially this was like this. 11 00:00:41,110 --> 00:00:47,530 Now, after dating, so consider this line, so after dating this line with the 90 degree, so this 12 00:00:47,530 --> 00:00:47,860 line. 13 00:00:48,910 --> 00:00:50,470 That new line will be this one. 14 00:00:50,500 --> 00:00:58,570 OK, so if this is the old line, if you can rotated by the 90 degree in the clockwise Badakshan, so 15 00:00:58,600 --> 00:01:00,140 this line will become like this. 16 00:01:00,160 --> 00:01:00,490 OK. 17 00:01:01,960 --> 00:01:03,850 Now, let us rotate this line. 18 00:01:05,379 --> 00:01:08,480 So it will look like this, I have three and one. 19 00:01:08,530 --> 00:01:11,610 OK, so in this way, this line will become this. 20 00:01:11,620 --> 00:01:13,360 So this will be three and this will be one. 21 00:01:13,600 --> 00:01:16,210 Initially, this was three and this was one. 22 00:01:16,240 --> 00:01:23,470 OK, now let's rotate this lane to rotate in the clockwise direction by 90 degrees so it will become 23 00:01:23,470 --> 00:01:24,240 full comma, too. 24 00:01:24,490 --> 00:01:28,690 OK, so this is the new matrix, three one for Commodore. 25 00:01:31,610 --> 00:01:35,120 OK, so after rotating this matrix, this is the new matrix. 26 00:01:35,630 --> 00:01:38,420 OK, now US did this matrix. 27 00:01:42,190 --> 00:01:44,830 OK, so now let us rotate this matrix. 28 00:01:46,880 --> 00:01:48,380 So this is. 29 00:01:50,800 --> 00:01:57,970 One four seven, so after reading this line, so after reading this line in the clockwise direction 30 00:01:57,970 --> 00:02:01,710 where 90 degree, so this will be the new this will be the new line. 31 00:02:01,720 --> 00:02:05,480 So it will be seven for one seven four one, OK. 32 00:02:05,710 --> 00:02:07,210 Now, let us read this line. 33 00:02:07,870 --> 00:02:11,039 So this this will become basically eight, five and two. 34 00:02:11,710 --> 00:02:15,820 And this is nine, then six and then three. 35 00:02:16,460 --> 00:02:18,460 OK, so this is the new matrix. 36 00:02:19,360 --> 00:02:19,890 Simple. 37 00:02:20,080 --> 00:02:21,830 Now, let us read this matrix. 38 00:02:21,850 --> 00:02:23,890 OK, so what. 39 00:02:24,070 --> 00:02:24,690 The first rule. 40 00:02:24,730 --> 00:02:25,090 So. 41 00:02:26,650 --> 00:02:28,270 Let us rotate this lane. 42 00:02:29,800 --> 00:02:34,480 So it will be 15, then 13, then two and then five. 43 00:02:36,610 --> 00:02:42,910 The second will be basically 14, then three, then four and then one, that third row will be, well, 44 00:02:43,300 --> 00:02:49,990 six, eight and nine and the photo will be sixteen, then seven, then 10 and then 11. 45 00:02:51,100 --> 00:02:57,930 OK, so this is basically the new matrix, OK, this will be the new matrix, so what we have to do, 46 00:02:58,330 --> 00:03:04,600 so we have to convert this matrix, we have to convert the input matrix into the new matrix. 47 00:03:04,600 --> 00:03:08,440 OK, the matrix, which is rotated by 90 degrees in the clockwise direction. 48 00:03:09,430 --> 00:03:13,310 OK, OK, so now let's discuss how we can solve this equation. 49 00:03:13,390 --> 00:03:16,210 OK, so this is a very simple question. 50 00:03:16,360 --> 00:03:19,240 OK, so let us consider one example. 51 00:03:19,250 --> 00:03:20,700 So suppose this is the Matrix. 52 00:03:20,710 --> 00:03:25,270 One, two, three, then I have four or five, six and then I have seven, eight, nine. 53 00:03:25,420 --> 00:03:30,770 OK, so now rotate this matrix by 90 degree in the clockwise direction. 54 00:03:31,030 --> 00:03:32,440 So what with a new matrix. 55 00:03:33,100 --> 00:03:39,610 So new matrix will be basically seven for one, then eight five two and then nine six three. 56 00:03:39,610 --> 00:03:41,140 OK, so what will do? 57 00:03:41,150 --> 00:03:42,990 So our approach is very simple. 58 00:03:43,000 --> 00:03:44,330 I have to perform two step. 59 00:03:44,350 --> 00:03:49,900 So first step is basically take transpose of the given matrix and the second step is after transpose 60 00:03:50,350 --> 00:03:51,160 what we will do. 61 00:03:51,190 --> 00:03:52,870 Basically we will reverse each rule. 62 00:03:53,440 --> 00:03:55,470 OK, reverse each rule. 63 00:03:55,960 --> 00:03:59,530 OK, so how I come to know that after being transferred and then reversed. 64 00:03:59,920 --> 00:04:01,520 So this is basically observation. 65 00:04:01,540 --> 00:04:07,390 OK, so this is basically observation if you will see the examples carefully, if you will observe carefully. 66 00:04:07,630 --> 00:04:09,450 So I have to perform two steps. 67 00:04:09,460 --> 00:04:13,180 First, I would take transpose and then I have to reverse each rule. 68 00:04:13,660 --> 00:04:17,019 OK, so let us take its transpose. 69 00:04:17,620 --> 00:04:22,330 So first step is basically taking transpose so and transpose what we will do. 70 00:04:22,330 --> 00:04:23,660 We will swapper win column. 71 00:04:23,680 --> 00:04:27,940 OK, so transpose means basically you will swap rows and columns. 72 00:04:29,740 --> 00:04:37,510 So let us take the transfer so it will become one, two, three, then I have four, five, six, then 73 00:04:37,510 --> 00:04:38,680 I have seven, eight, nine. 74 00:04:38,750 --> 00:04:40,700 OK, so this was one, two, three. 75 00:04:40,960 --> 00:04:42,160 Now this is one, two, three. 76 00:04:42,850 --> 00:04:44,060 This is four, five, six. 77 00:04:44,080 --> 00:04:45,450 Now this is four, five, six. 78 00:04:45,970 --> 00:04:47,230 So this was seven, eight, nine. 79 00:04:47,260 --> 00:04:48,520 Now this is seven, eight, nine. 80 00:04:48,550 --> 00:04:53,200 OK, so transport's taking is very, very simple, but you have to do so. 81 00:04:53,200 --> 00:04:54,920 I have to strap Ruen column. 82 00:04:54,970 --> 00:04:56,310 OK, so if this was the rule. 83 00:04:57,340 --> 00:05:04,510 Now, make it clear if this was the second rule, make it second column, if this was the third rule, 84 00:05:04,510 --> 00:05:05,960 then make it third column. 85 00:05:05,980 --> 00:05:07,700 OK, very, very simple. 86 00:05:07,750 --> 00:05:09,760 We are just swapping rules and columns. 87 00:05:10,450 --> 00:05:13,510 OK, now the second step, basically, I have to reverse each rule. 88 00:05:13,930 --> 00:05:15,950 So now let's reverse this first rule. 89 00:05:16,240 --> 00:05:18,070 So it will become seven for one. 90 00:05:18,340 --> 00:05:20,140 Now let us reverse the second rule. 91 00:05:20,350 --> 00:05:24,230 So it will become eight five to reverse the third rule. 92 00:05:24,250 --> 00:05:25,980 So it will become nine six three. 93 00:05:26,020 --> 00:05:27,480 OK, and you can match. 94 00:05:29,200 --> 00:05:30,370 So they both have same. 95 00:05:31,570 --> 00:05:37,840 OK, so if you follow these two steps first taking place first and then reverse each row, we will be 96 00:05:37,840 --> 00:05:39,190 able to soil our question. 97 00:05:39,530 --> 00:05:43,090 OK, now let's take one more example if you want to understand it. 98 00:05:43,210 --> 00:05:45,250 OK, let's take one more example. 99 00:05:48,610 --> 00:05:52,310 So basically, let's take this one example, the example which is given in the question. 100 00:05:52,420 --> 00:05:52,720 OK. 101 00:05:55,060 --> 00:05:58,380 We just have to follow two steps, transpose and then reverse each. 102 00:05:58,750 --> 00:06:01,180 OK, so let us take the transpose. 103 00:06:01,360 --> 00:06:05,890 The first step, first step is basically taking the task force. 104 00:06:06,790 --> 00:06:09,140 Big task force means we're perusing columns. 105 00:06:09,160 --> 00:06:12,260 So if this is the first rule, I will make it first column. 106 00:06:12,280 --> 00:06:14,440 So this is five one nine 11. 107 00:06:15,630 --> 00:06:16,680 This is the second rule. 108 00:06:16,690 --> 00:06:20,710 Make it second column so it will become two four eight. 109 00:06:20,710 --> 00:06:23,110 And then this is the third rule. 110 00:06:23,320 --> 00:06:24,550 Make it third column. 111 00:06:25,060 --> 00:06:27,970 So 13, three, six and seven. 112 00:06:28,930 --> 00:06:29,980 This is the fourth rule. 113 00:06:29,980 --> 00:06:31,210 Make it fourth column. 114 00:06:31,240 --> 00:06:36,670 OK, so this will be 15, then 14, then 12 and then 16. 115 00:06:36,700 --> 00:06:42,790 OK, so after this, after the first step, what is the second step to second steps is reverse each 116 00:06:42,790 --> 00:06:43,030 rule. 117 00:06:43,480 --> 00:06:46,090 OK, we will reverse each rule. 118 00:06:46,210 --> 00:06:47,940 Every single rule will be reversed. 119 00:06:49,430 --> 00:06:56,780 OK, so now let's reverse this little so it will be basically 15, then 13, then two and then five, 120 00:06:57,080 --> 00:06:58,140 now reverse this rule. 121 00:06:58,430 --> 00:07:04,000 So this is 14, then three, then four, then one reversed this rule. 122 00:07:04,010 --> 00:07:07,390 So it is 12, then six, then eight, then nine. 123 00:07:07,850 --> 00:07:08,910 Now reverse this rule. 124 00:07:09,290 --> 00:07:13,670 So this will be 16, then seven, then 10 and then 11. 125 00:07:13,700 --> 00:07:15,260 OK, now you can match. 126 00:07:17,230 --> 00:07:18,640 OK, so they both have some. 127 00:07:19,970 --> 00:07:24,880 OK, they both have him, so basically our goal is going to be look very, very simple. 128 00:07:25,130 --> 00:07:30,170 First, I will write the code for taking the transpose, which is nothing, just rows and columns. 129 00:07:30,440 --> 00:07:33,000 And the second is basically I will reverse the Egil. 130 00:07:33,080 --> 00:07:36,740 OK, now what will be the time and the space complexity? 131 00:07:37,940 --> 00:07:39,680 So first, I am digging transport. 132 00:07:40,100 --> 00:07:41,630 So how much time it will take? 133 00:07:41,660 --> 00:07:47,960 So simply it will take into account the dimensions of the matrix that and so I have to go through each 134 00:07:47,960 --> 00:07:48,800 and every element. 135 00:07:48,810 --> 00:07:52,500 So it will take an enduring time and then I have to reverse each rule. 136 00:07:52,600 --> 00:07:57,040 OK, so what I will do, I will go through each and every rule and I will take the reverse. 137 00:07:57,080 --> 00:08:01,520 So bless and doing OK for reversing each rule. 138 00:08:01,730 --> 00:08:05,480 So basically, if you will add these two sort time complexities basically and square. 139 00:08:06,610 --> 00:08:09,370 And the space complexities basically are drawn, OK? 140 00:08:09,380 --> 00:08:11,380 We are we will not use any extra space. 141 00:08:12,310 --> 00:08:15,010 So this is the time and the space complexity for the solution. 142 00:08:15,040 --> 00:08:17,920 OK, digging transports and reversing each little. 143 00:08:19,090 --> 00:08:22,570 OK, so now let us write the code if you understood the logic. 144 00:08:26,090 --> 00:08:31,320 OK, so the government has basically passed by reference, OK, so we have to do changes in the government 145 00:08:31,490 --> 00:08:33,900 only we do not have to create new metrics. 146 00:08:33,919 --> 00:08:36,740 OK, we have to solve this question in place. 147 00:08:36,750 --> 00:08:41,570 So the meaning of this is basically the changes in the same metrics. 148 00:08:41,750 --> 00:08:43,700 OK, do not allocate any extra space. 149 00:08:45,110 --> 00:08:46,490 So now let us write the code. 150 00:08:47,420 --> 00:08:50,900 So first let us find out how many rules and columns are present. 151 00:08:50,930 --> 00:08:52,910 OK, so. 152 00:08:55,200 --> 00:08:56,410 Let's call it Immonen. 153 00:08:56,460 --> 00:08:58,920 OK, so this is basically tech, Start says. 154 00:09:02,550 --> 00:09:06,180 And what is and so this is metrics of zero Dorseys. 155 00:09:09,980 --> 00:09:16,460 Now, after finding out this is what you have to do, so basically first step, we have to take the 156 00:09:16,460 --> 00:09:17,090 transport. 157 00:09:18,860 --> 00:09:21,910 And passement means sabras in columns. 158 00:09:22,340 --> 00:09:27,110 OK, we will swap roles in columns, take the transpose. 159 00:09:27,830 --> 00:09:30,590 OK, so now let us write the code for taking the task force. 160 00:09:31,960 --> 00:09:33,380 Zero equals zero. 161 00:09:35,590 --> 00:09:37,990 Is M Andrew Placeless? 162 00:09:43,590 --> 00:09:47,210 Then column so column will start from the. 163 00:09:49,170 --> 00:09:53,550 Then Collum less than N and then column placeless. 164 00:09:55,440 --> 00:10:00,990 Now, what we have to do, so basically I have to strap rows and columns, so this is basically a matrix 165 00:10:00,990 --> 00:10:01,260 of. 166 00:10:03,210 --> 00:10:05,880 Column, Animatrix of column. 167 00:10:11,530 --> 00:10:13,100 OK, very simple. 168 00:10:13,600 --> 00:10:15,340 So basically at this point. 169 00:10:17,060 --> 00:10:19,590 Our task force is done now what we have to do. 170 00:10:19,940 --> 00:10:22,160 I have to reverse each second step. 171 00:10:23,240 --> 00:10:24,890 So the second step is basically. 172 00:10:26,620 --> 00:10:27,820 The reverse is true. 173 00:10:28,340 --> 00:10:32,310 OK, so what we'll do, I will go through each and every rule and I will reverse them. 174 00:10:34,480 --> 00:10:40,180 So I have to go through each and every rule, so I loop for going through each and every rule. 175 00:10:43,130 --> 00:10:44,320 Total Ambros out there. 176 00:10:44,440 --> 00:10:44,770 OK. 177 00:10:47,280 --> 00:10:50,250 Now, how to reverse so we know how to reverse. 178 00:10:51,740 --> 00:10:57,210 OK, so considering that now, if you want to give us an idea what we will do, it will take two point 179 00:10:57,250 --> 00:11:00,710 that you have a start point out here and you will pick and point out here. 180 00:11:00,950 --> 00:11:05,720 And similarly what you will do, you will start point and point to the starting point and move in this 181 00:11:05,720 --> 00:11:07,930 direction and move in this direction. 182 00:11:08,120 --> 00:11:09,700 So we will able to start placeless. 183 00:11:09,770 --> 00:11:11,030 I will do anything minus minus. 184 00:11:11,570 --> 00:11:12,400 I will continue. 185 00:11:12,420 --> 00:11:18,680 This thing will basically start is less than ideal and or you can write and will start this Lieutenant. 186 00:11:18,710 --> 00:11:19,040 OK. 187 00:11:22,600 --> 00:11:27,610 Now, let us create a start and end point, so the start point that will be at zero position. 188 00:11:28,740 --> 00:11:33,390 And that will be out basically and minus one politician, OK, and is the number of columns. 189 00:11:35,500 --> 00:11:40,150 Now, while it's this list than ideal Westwind, what do you have to do, you will slap. 190 00:11:41,220 --> 00:11:43,110 OK, so I have to step. 191 00:11:45,400 --> 00:11:47,320 Railways fixed, the value of roads fixed. 192 00:11:47,870 --> 00:11:49,240 OK, I'm reversing that. 193 00:11:49,780 --> 00:11:59,800 So start and similarly mattocks of is fixed basically and the column is variable, so it will be end. 194 00:11:59,860 --> 00:12:02,320 OK, I'm scrapping the start in the end. 195 00:12:02,320 --> 00:12:03,970 Point out what I will do. 196 00:12:03,990 --> 00:12:06,460 I'm I will do start placeless slightly. 197 00:12:06,460 --> 00:12:06,940 Move ahead. 198 00:12:06,940 --> 00:12:08,530 I will do end minus minus. 199 00:12:08,560 --> 00:12:10,830 OK, now our second step is also done. 200 00:12:11,120 --> 00:12:16,350 OK, so our first step taking transpose, our second step reversing the arrow. 201 00:12:17,020 --> 00:12:18,710 Now I think our goal will work fine. 202 00:12:18,730 --> 00:12:21,850 OK, now let us try to run our code and then we will try to submit. 203 00:12:27,230 --> 00:12:30,560 OK, so we are getting wrong on, so that means we did something wrong. 204 00:12:30,890 --> 00:12:31,370 Let's see. 205 00:12:35,900 --> 00:12:37,850 OK, so the mistake is basically. 206 00:12:39,070 --> 00:12:41,290 I forgot to initialize a rule. 207 00:12:41,320 --> 00:12:44,560 OK, so what is happening here is if you will see it carefully. 208 00:12:45,990 --> 00:12:50,940 So if this is the matrix, so I want my taxes, particularly one, two, three, then four, five, 209 00:12:50,940 --> 00:12:52,800 six, and then seven, eight, nine. 210 00:12:52,890 --> 00:12:55,040 OK, now let us take the transport. 211 00:12:55,050 --> 00:13:02,700 So it starts both will basically be one, two, three, then four, five, six, and then seven, eight 212 00:13:02,850 --> 00:13:03,400 and nine. 213 00:13:03,450 --> 00:13:06,150 OK, so our first rule is basically one four seven. 214 00:13:06,330 --> 00:13:07,630 So this is one four seven. 215 00:13:07,950 --> 00:13:12,380 Then our second rule is basically to five, eight to five it then our third rule is basically three 216 00:13:12,390 --> 00:13:12,910 six nine. 217 00:13:12,990 --> 00:13:14,160 So this is the third rule. 218 00:13:14,190 --> 00:13:18,750 OK, basically what we are doing, our reverse function is not locking. 219 00:13:19,750 --> 00:13:25,270 OK, our rivers function is not working because you can see here I forgot to initialize it all with 220 00:13:25,270 --> 00:13:25,660 zero. 221 00:13:25,690 --> 00:13:27,640 OK, will be initialized with zero. 222 00:13:28,150 --> 00:13:29,590 So now let us do the correction. 223 00:13:32,370 --> 00:13:34,270 So will be initialized to zero. 224 00:13:34,320 --> 00:13:40,050 OK, now this is correct, after initially said over zero, so now Ladson. 225 00:13:43,660 --> 00:13:46,960 OK, so our court is working fine now let us strive to submit our good. 226 00:13:51,200 --> 00:13:53,270 OK, so our goal is working fine. 227 00:13:54,520 --> 00:14:00,250 Now, as discussed, what is the time Diamond, the space complexity, so we know the time complexity 228 00:14:00,250 --> 00:14:06,790 is basically order off and then you can say and square because it is a given that the dimensions are 229 00:14:06,790 --> 00:14:10,450 increasing, OK, and the space complexity is basically ordered offline. 230 00:14:10,960 --> 00:14:13,690 OK, now let's discuss some good examples. 231 00:14:15,750 --> 00:14:17,070 So here in discussion. 232 00:14:18,240 --> 00:14:20,530 Let us talk about some more informations. 233 00:14:20,590 --> 00:14:29,130 OK, so the given question is basically so if we have to rotate the metrics by 90 degrees clockwise 234 00:14:29,130 --> 00:14:30,890 direction, so that means plus 90. 235 00:14:30,900 --> 00:14:35,140 OK, so 90 degrees clockwise direction, so clockwise I'm taking place. 236 00:14:35,190 --> 00:14:39,370 OK, so we have to rotate by plus degree, rotate by plus 90 degrees. 237 00:14:39,750 --> 00:14:41,190 Then the approach is very simple. 238 00:14:42,490 --> 00:14:45,730 First, big the transport and then reverse each. 239 00:14:46,160 --> 00:14:48,580 OK, big transports and reverse each. 240 00:14:49,930 --> 00:14:56,440 Now, if the question is basically rotate by minus 90 degree, if this is the question, rotate by minus 241 00:14:56,440 --> 00:14:59,090 90 degrees or minus means in the anticlockwise direction. 242 00:14:59,110 --> 00:15:02,380 OK, so what I will do, I will take the transport. 243 00:15:04,270 --> 00:15:06,910 And then basically, I will reverse each column. 244 00:15:07,480 --> 00:15:10,870 OK, so instead of reversing each rule, I will reverse each column. 245 00:15:11,320 --> 00:15:11,830 Simple. 246 00:15:12,220 --> 00:15:19,510 Now if the question is basically rotate by plus 180 degrees, that means 180 degrees in the clockwise 247 00:15:19,510 --> 00:15:20,000 direction. 248 00:15:20,380 --> 00:15:22,580 So there are two ways to solve this question. 249 00:15:22,600 --> 00:15:25,410 OK, so the first rule is basically what I will do. 250 00:15:26,230 --> 00:15:27,690 So I will follow this approach. 251 00:15:27,700 --> 00:15:29,620 I will rotate by plus 90 degree. 252 00:15:30,820 --> 00:15:34,590 I will rotate where plus 90 degrees and I will perform this step two times. 253 00:15:34,640 --> 00:15:40,810 OK, I will perform the rotation by 90 degree two times, OK, rotation by 90 degrees two times. 254 00:15:41,230 --> 00:15:42,950 So it will be plus 180 degrees. 255 00:15:43,480 --> 00:15:46,480 Now, the second step basically is very simple. 256 00:15:46,490 --> 00:15:48,980 What we will do, you will reverse. 257 00:15:49,660 --> 00:15:51,110 So basically there are two ways. 258 00:15:51,130 --> 00:15:52,150 So this is the first. 259 00:15:52,150 --> 00:15:54,210 We rotate by 90 degrees two times. 260 00:15:54,490 --> 00:15:58,600 Secondly, to solve this question is basically reverse each rule. 261 00:16:00,940 --> 00:16:04,600 And also the first column was each row and reverse each column. 262 00:16:05,170 --> 00:16:11,420 OK, now the fourth type of problem can be I have to rotate by minus 180. 263 00:16:11,920 --> 00:16:15,520 That means 180 degrees in the anticlockwise direction. 264 00:16:15,550 --> 00:16:19,390 OK, so again, there are three steps to solve this problem. 265 00:16:19,760 --> 00:16:23,000 OK, so basically there are three ways to solve this problem. 266 00:16:23,020 --> 00:16:24,650 So first rate is basically what I will do. 267 00:16:25,480 --> 00:16:32,260 I will rotate by minus 90 degrees and I will do the rotation by minus 90 degrees two times. 268 00:16:32,290 --> 00:16:32,680 OK. 269 00:16:34,680 --> 00:16:40,650 I will rotate by minus 90 degrees and I will do it two times, so in total it will be minus 180 degree 270 00:16:41,070 --> 00:16:41,580 simple. 271 00:16:42,270 --> 00:16:45,000 Now, the second way is basically what you can do. 272 00:16:46,070 --> 00:16:53,620 You will reverse each column and then basically you will reverse each rule. 273 00:16:54,210 --> 00:16:55,880 OK, so this is the second we. 274 00:16:56,840 --> 00:17:03,770 The third way is basically rotate by minus 180 degree is basically the same as. 275 00:17:05,670 --> 00:17:07,950 Rotate by plus 180 degree. 276 00:17:08,760 --> 00:17:11,369 OK, so the AC. 277 00:17:16,079 --> 00:17:20,800 OK, so if you will rotate by minus 180 degrees or you will rotate way plus 180 degrees. 278 00:17:20,819 --> 00:17:25,240 Basically, they both are saying, OK, you can take an example to see yourself. 279 00:17:25,260 --> 00:17:28,020 OK, so these these are four types of problem. 280 00:17:28,020 --> 00:17:33,410 If you have to rotate by plus 90 degree that we have already solved, transpose and reverse each little 281 00:17:33,690 --> 00:17:37,470 second is basically minus 180 degrees, again, transposed to reverse each column. 282 00:17:38,100 --> 00:17:42,360 That is basically the third type of question can be rotate by plus 180 degrees. 283 00:17:42,720 --> 00:17:48,900 So the first rate is always this one plus nine to the rotation by plus 90 degree and make it two times. 284 00:17:48,960 --> 00:17:54,990 OK, the second one is basically you will reverse each rule and reverse each column and minus 180 degrees 285 00:17:55,170 --> 00:18:01,830 again, but from the rotation by minus 90 degrees two times or the second way to basically reverse each 286 00:18:01,830 --> 00:18:03,120 column, then reverse each row. 287 00:18:03,330 --> 00:18:08,310 And third, which is basically rotation by a minus 180 degree or rotation by plus 180 degree, they 288 00:18:08,310 --> 00:18:15,720 both are saying, OK, now plus means clockwise direction, minus Miss Anticlockwise Direction. 289 00:18:16,170 --> 00:18:16,560 OK. 290 00:18:18,280 --> 00:18:22,910 OK, so this is not anticlockwise, this is anticlockwise, OK, so I remembered. 291 00:18:23,800 --> 00:18:25,460 So this is not clockwise. 292 00:18:25,780 --> 00:18:26,980 This is not anticlockwise. 293 00:18:26,980 --> 00:18:28,300 Anticlockwise is this one. 294 00:18:29,590 --> 00:18:31,900 And similarly, so this is minus. 295 00:18:31,900 --> 00:18:34,390 So this is anticlockwise. 296 00:18:34,420 --> 00:18:35,740 OK, sorry, I'm very sorry. 297 00:18:36,100 --> 00:18:38,680 So this is minus decis anticlockwise. 298 00:18:38,890 --> 00:18:45,280 OK, finally, this is clockwise in the direction of glogg and this is anticlockwise opposite to the 299 00:18:45,280 --> 00:18:46,120 direction of Gloc. 300 00:18:46,190 --> 00:18:49,690 OK, so if you have any doubt in this question, you can ask me. 301 00:18:49,750 --> 00:18:50,590 OK, one more thing. 302 00:18:51,260 --> 00:18:53,980 The time, complexity and all the solution will be emon. 303 00:18:55,190 --> 00:18:57,000 And the space complexity will be open. 304 00:18:57,080 --> 00:19:00,020 OK, we are just traversing through each and every element. 305 00:19:01,150 --> 00:19:02,450 OK, so thank you.