1 00:00:00,770 --> 00:00:01,410 Hi, everyone. 2 00:00:01,430 --> 00:00:04,360 So today we will solve this question, zigzag pattern. 3 00:00:05,290 --> 00:00:11,960 OK, so the input will basically be a string and the second input will basically be the number of rules. 4 00:00:12,280 --> 00:00:14,370 OK, so these are the number of rules. 5 00:00:15,050 --> 00:00:18,220 Now, what we have to do since the number of rules is basically two. 6 00:00:18,320 --> 00:00:19,610 So I will make two rules. 7 00:00:19,610 --> 00:00:21,990 So this is rule one and this is rule two. 8 00:00:22,250 --> 00:00:23,610 Now I read all the string. 9 00:00:23,630 --> 00:00:27,680 OK, so so right in the first rule, then IFB. 10 00:00:27,890 --> 00:00:28,450 So right. 11 00:00:28,460 --> 00:00:30,860 Be in the second row then AFSC. 12 00:00:30,860 --> 00:00:34,400 So right in the first row then I have this already. 13 00:00:34,630 --> 00:00:38,630 OK, and this is my first rule and this is my second rule. 14 00:00:39,790 --> 00:00:41,450 OK, and then first. 15 00:00:42,080 --> 00:00:42,520 Right. 16 00:00:42,530 --> 00:00:43,140 First rule. 17 00:00:43,160 --> 00:00:45,260 So this is easy then. 18 00:00:45,260 --> 00:00:45,640 Right. 19 00:00:45,650 --> 00:00:46,350 Second rule. 20 00:00:46,370 --> 00:00:47,330 So this is beardie. 21 00:00:47,960 --> 00:00:49,270 This is really OK. 22 00:00:49,460 --> 00:00:51,020 So this is the output. 23 00:00:52,570 --> 00:00:56,170 OK, this is the output for Decentered AC Beardie. 24 00:00:57,180 --> 00:01:00,030 OK, now let us consider this string, OK? 25 00:01:00,040 --> 00:01:02,220 And the number of rows is basically three. 26 00:01:02,620 --> 00:01:04,900 So this is my first row. 27 00:01:06,340 --> 00:01:10,500 This is my second row and this is my third row. 28 00:01:11,870 --> 00:01:15,500 OK, so now let's get rid of the string and fill this room. 29 00:01:15,660 --> 00:01:18,380 OK, so this string is basically people. 30 00:01:19,490 --> 00:01:30,500 Is hiding, OK, people is hiding, so I have be so right be then I have a then I have my again B then 31 00:01:30,500 --> 00:01:34,430 A then and so people then I. 32 00:01:35,630 --> 00:01:38,900 S is hiding, so H. 33 00:01:40,000 --> 00:01:40,510 I. 34 00:01:41,470 --> 00:01:41,980 All right. 35 00:01:43,080 --> 00:01:43,530 I. 36 00:01:44,500 --> 00:01:52,090 And Angie, OK, and now forward producing the output, so for writing the output, right, the first 37 00:01:52,090 --> 00:01:52,310 row. 38 00:01:52,330 --> 00:01:53,200 So first is. 39 00:01:54,140 --> 00:01:54,560 B. 40 00:01:55,080 --> 00:02:01,540 And so this is first row, be a edge and then right the second row. 41 00:02:01,590 --> 00:02:12,770 So this is Apple s i g so a b l s i i g then right. 42 00:02:12,770 --> 00:02:18,310 The third row, which is why I was so why I said OK, why I. 43 00:02:18,710 --> 00:02:22,820 So this is the output for this input. 44 00:02:23,860 --> 00:02:27,740 OK, so I hope you understood this question, let us see one more example. 45 00:02:28,660 --> 00:02:30,970 So this question is basically a literal. 46 00:02:31,390 --> 00:02:36,190 OK, so people is hiding and the number of laws is basically. 47 00:02:37,330 --> 00:02:39,030 OK, so we will create four rules. 48 00:02:39,760 --> 00:02:42,540 So I have this is the first rule. 49 00:02:42,550 --> 00:02:45,460 This is second rule, third and fourth rule. 50 00:02:45,790 --> 00:02:50,650 Now people deciding so be a Y be. 51 00:02:51,810 --> 00:02:53,370 A l. 52 00:02:54,240 --> 00:02:54,750 S. 53 00:02:57,050 --> 00:02:57,620 Ich. 54 00:02:58,990 --> 00:03:00,680 I are. 55 00:03:01,660 --> 00:03:02,140 I. 56 00:03:03,280 --> 00:03:03,730 And. 57 00:03:04,800 --> 00:03:12,150 And OK, so we will write the output of the first row, which is span the output of Secondo, which 58 00:03:12,150 --> 00:03:13,880 is a L. 59 00:03:13,890 --> 00:03:21,230 S IGY, then the third row, which is why Echard then the output of falderal, which is by OK. 60 00:03:21,540 --> 00:03:25,410 So this is the output for this input. 61 00:03:25,950 --> 00:03:32,750 OK, you can be any less a G by H are being OK. 62 00:03:32,760 --> 00:03:34,620 So our output is basically correct. 63 00:03:35,190 --> 00:03:39,330 OK, so this is the question now how we can solve this question. 64 00:03:39,330 --> 00:03:42,630 So this question is again a simply implementation problem. 65 00:03:43,360 --> 00:03:47,230 OK, so this question is basically assembly implementation problem. 66 00:03:47,700 --> 00:03:49,770 Now let's see how we can solve this problem. 67 00:03:49,800 --> 00:03:50,100 OK. 68 00:03:52,790 --> 00:03:57,410 So let us consider this example, people deciding and the number of rose is basically three. 69 00:04:00,390 --> 00:04:06,180 So a number of sources, basically three, so a number of rows is basically three. 70 00:04:06,480 --> 00:04:08,040 So what we will do, we will create. 71 00:04:11,010 --> 00:04:12,290 So we will create an 80. 72 00:04:14,220 --> 00:04:16,649 OK, so we will get an array of size three. 73 00:04:17,519 --> 00:04:20,920 OK, so this is basically the zero index. 74 00:04:20,940 --> 00:04:24,230 This is the first index of the area and this is the second index of the area. 75 00:04:24,660 --> 00:04:28,770 And inside the each index, I will store a string. 76 00:04:30,150 --> 00:04:36,390 So there's a index will store restring the first indexable Storrar string and the second indexable store 77 00:04:36,390 --> 00:04:36,870 restring. 78 00:04:37,500 --> 00:04:40,380 OK, so basically I will write something like this. 79 00:04:41,220 --> 00:04:45,630 I want to create an area of a string, so let's call it string then. 80 00:04:45,750 --> 00:04:50,160 Let's say the name is Star and the size will be Namaroff Rose. 81 00:04:51,880 --> 00:04:59,050 OK, so if you want to create the entire area, what you write, you write and edit and size three, 82 00:04:59,470 --> 00:05:03,730 but if you want to create an array of a string, so this is the syntax string. 83 00:05:03,880 --> 00:05:09,460 First of all, you write the letter type so that your diapers and other types of string, then the name 84 00:05:09,460 --> 00:05:19,060 of the array and then the size of the OK, so first of all, I will create this area so each index will 85 00:05:19,060 --> 00:05:24,370 store a string, OK, and then we will fill the values in these indexes. 86 00:05:24,610 --> 00:05:29,690 And after we have this value in these indexes, I will trade over data and what I will do. 87 00:05:29,710 --> 00:05:31,020 So let's call it answer. 88 00:05:31,360 --> 00:05:34,840 So I will write answered plus equals two. 89 00:05:34,840 --> 00:05:37,900 So the first string, the name of the ad is basically a. 90 00:05:38,300 --> 00:05:39,870 So I will write StarOffice. 91 00:05:40,370 --> 00:05:46,300 OK, so this plus operator can do so with the help of this plus operator you can append boosting for 92 00:05:46,300 --> 00:05:51,940 example string A's ABC and you have an industry let's call it. 93 00:05:53,590 --> 00:06:02,770 D.F., OK, and I would tell physically, actually, plus the survival rate plus operators of this plus 94 00:06:02,770 --> 00:06:04,390 operator can append to strings. 95 00:06:04,390 --> 00:06:07,680 So this answer will contain ABC BBF. 96 00:06:08,050 --> 00:06:15,670 OK, so initially our answer will be empty and then we have filled this completely. 97 00:06:15,700 --> 00:06:22,420 What we will do, we will iterate over this area and then we will surplused close to a string of I guess 98 00:06:22,540 --> 00:06:24,270 that is basically the name of the area. 99 00:06:25,120 --> 00:06:28,150 Now let's see how we can fill this area. 100 00:06:28,450 --> 00:06:30,520 OK, let us consider an example. 101 00:06:33,690 --> 00:06:36,870 OK, so I have the string people is hiding. 102 00:06:40,180 --> 00:06:45,400 So in this example, the number of rose is basically three, OK, since a number of Rose is basically 103 00:06:45,400 --> 00:06:51,760 three, but I have to do I will create 80, I will create an area of Sastry. 104 00:06:51,970 --> 00:06:54,950 And inside this area, what I will do, I will store a string. 105 00:06:54,970 --> 00:07:02,050 OK, so this will store a string, this will store a string and this will store a string. 106 00:07:03,220 --> 00:07:05,570 So this is zero, this is one, and this is the next. 107 00:07:06,070 --> 00:07:10,960 So now let us I tripped over the string, so be right, be here then. 108 00:07:10,960 --> 00:07:14,450 I have a so right here then I have I see. 109 00:07:14,500 --> 00:07:16,960 Right right here then IFB. 110 00:07:17,350 --> 00:07:18,160 So I cannot. 111 00:07:18,160 --> 00:07:18,460 Right. 112 00:07:18,460 --> 00:07:20,740 Be here because I have reached the end of the string. 113 00:07:20,740 --> 00:07:23,860 So I will move up but I will move about so I will. 114 00:07:23,860 --> 00:07:24,230 Right. 115 00:07:24,250 --> 00:07:24,820 Be here. 116 00:07:25,510 --> 00:07:33,100 OK then I have it so I will right here then I have l so I cannot right l here because this index does 117 00:07:33,100 --> 00:07:36,160 not exist so I have to move down so far moving down. 118 00:07:36,160 --> 00:07:37,210 I will write l here. 119 00:07:37,480 --> 00:07:43,060 OK, so I have s I can write I here I have s again. 120 00:07:43,090 --> 00:07:44,440 We cannot write s here. 121 00:07:44,440 --> 00:07:47,470 OK, so we will write s here then. 122 00:07:47,470 --> 00:07:50,570 I have it so right h here then I. 123 00:07:50,980 --> 00:08:00,370 So again we cannot write I here so I will write, I hear then I ring so I and nd and G. 124 00:08:00,590 --> 00:08:03,520 OK, so what is the situation. 125 00:08:03,550 --> 00:08:07,690 So basically the zero index is containing this string BGH and. 126 00:08:09,610 --> 00:08:13,060 The second the first index is containing this string. 127 00:08:15,950 --> 00:08:18,950 And our third index is basically containing the string. 128 00:08:20,100 --> 00:08:22,620 Now, what we have to do, so we have to hydrate. 129 00:08:24,010 --> 00:08:30,510 Over this area, and suppose our answer is basically empty, then what we have to do, we have to right 130 00:08:30,510 --> 00:08:34,880 answer because I'm in surplus now, the surplus operator can append two strings. 131 00:08:35,130 --> 00:08:37,419 So let's say the name of this Ediz star. 132 00:08:37,710 --> 00:08:39,360 So what I will write, I will write. 133 00:08:40,169 --> 00:08:43,770 Start off I OK, so I am bending the strings. 134 00:08:43,770 --> 00:08:45,970 So this is the first string which will be appended. 135 00:08:45,990 --> 00:08:47,470 So this is B itchin. 136 00:08:48,330 --> 00:08:52,200 Now this string will be appended so it will become a b l. 137 00:08:52,380 --> 00:08:56,160 S igy and then I will bend the strings. 138 00:08:56,160 --> 00:09:00,000 So this is why I r and this will be our output. 139 00:09:00,630 --> 00:09:03,300 So this is basically the answer string. 140 00:09:03,850 --> 00:09:05,440 OK, so very simple. 141 00:09:05,460 --> 00:09:07,880 This is just the implementation problem, ok. 142 00:09:08,340 --> 00:09:09,870 Only implementation problem. 143 00:09:09,900 --> 00:09:11,550 Now let us write the code for this. 144 00:09:11,740 --> 00:09:12,090 OK. 145 00:09:16,540 --> 00:09:23,370 So now let us write the code, so input is basically a string and we have to return a string. 146 00:09:23,380 --> 00:09:25,520 OK, and this is the number of rules. 147 00:09:26,500 --> 00:09:30,330 So first, let us handle some very simple cases. 148 00:09:30,940 --> 00:09:38,050 So if the number of rules is less than or equal to one, if there is only one rule, OK, you can do 149 00:09:38,050 --> 00:09:41,890 it later than the given string because you do not have to do any changes. 150 00:09:43,430 --> 00:09:49,730 OK, so now let us find out the length of the string, so this is as nazis'. 151 00:09:53,340 --> 00:09:56,690 OK, so now let us create this, Eddie. 152 00:09:56,880 --> 00:09:59,880 OK, so I have to create this Eddie. 153 00:10:00,980 --> 00:10:03,870 OK, so you want each and short stories string. 154 00:10:03,910 --> 00:10:10,080 So the syntax will be that first string, then the name of that, let's say the name of that is basically 155 00:10:10,620 --> 00:10:10,980 OK. 156 00:10:10,990 --> 00:10:16,430 And then the size of the area, which is basically the number of rules, OK, if the number of rules 157 00:10:16,440 --> 00:10:19,120 is basically three, then the size of the area is basically three. 158 00:10:19,410 --> 00:10:21,480 So this is the way to create a static area. 159 00:10:22,410 --> 00:10:29,160 But we know whenever we want to create an area and whose size is basically a variable, the better way 160 00:10:29,160 --> 00:10:32,250 to create that is with the help of a dynamic allocation. 161 00:10:32,280 --> 00:10:36,270 OK, so instead of creating a third degree, I will create a dynamic. 162 00:10:36,740 --> 00:10:44,840 So syntax will be string, then start, then the name of that which is new, and then that ended up 163 00:10:44,860 --> 00:10:48,350 which is string and then the size. 164 00:10:49,260 --> 00:10:54,240 OK, so while we have to create this dynamic area, why not category? 165 00:10:54,540 --> 00:10:56,370 Because this value is variable. 166 00:10:56,460 --> 00:10:56,800 OK. 167 00:10:57,300 --> 00:11:02,310 So whenever you have a variable size, the better way is to use dynamic allocation. 168 00:11:02,370 --> 00:11:09,750 OK, so string start the name of the array, so a new operator and then the other type and then they 169 00:11:09,750 --> 00:11:10,590 say OK. 170 00:11:14,100 --> 00:11:16,230 So strings start led the Nimoy's. 171 00:11:17,850 --> 00:11:24,840 So this is new type string and size, basically endless number of arrows. 172 00:11:26,310 --> 00:11:29,760 OK, so now let us trade all the string. 173 00:11:32,070 --> 00:11:37,120 So I'm taking a variable role, which is initially zero, and let us take a variable step. 174 00:11:37,140 --> 00:11:37,560 Also. 175 00:11:40,580 --> 00:11:42,970 So now let us say straightforwardly interesting. 176 00:11:43,040 --> 00:11:43,400 OK. 177 00:11:46,440 --> 00:11:49,470 So for our I am using a while loop a follow up. 178 00:11:49,550 --> 00:11:49,770 OK. 179 00:11:52,090 --> 00:12:00,160 So now what we have to do, so the name of that is so a adverting next, I have to push so for using 180 00:12:00,160 --> 00:12:02,830 the index, I have created this variable. 181 00:12:03,190 --> 00:12:06,810 OK, and what role I have to push the current character. 182 00:12:07,150 --> 00:12:09,430 So that's why I have created this variable. 183 00:12:09,700 --> 00:12:13,080 All you can see, this is index zero. 184 00:12:13,120 --> 00:12:14,020 This is index one. 185 00:12:14,020 --> 00:12:14,880 This is index too. 186 00:12:15,100 --> 00:12:20,380 So basically for moving these indexes, for storing these indexes, I am taking a variable role. 187 00:12:20,590 --> 00:12:23,230 OK, so initially I have to put at index zero. 188 00:12:23,240 --> 00:12:26,260 So that's why ruys initialized with zero then what I will do. 189 00:12:26,680 --> 00:12:33,030 So I will do Roebling's plus four going to index one, then I will go to index two. 190 00:12:33,040 --> 00:12:34,780 So I will again do rule plus. 191 00:12:34,780 --> 00:12:38,110 Plus after reaching the index do I have to move above. 192 00:12:39,120 --> 00:12:42,370 I have to move above, so basically I have to do room minus minus. 193 00:12:42,440 --> 00:12:45,750 OK, so basically this plus plus and this minus minus thing. 194 00:12:46,020 --> 00:12:48,870 So it'll become to make this thing is what I'm doing. 195 00:12:48,870 --> 00:12:50,600 I'm keeping a variable step. 196 00:12:50,850 --> 00:12:52,290 So this step is basically one. 197 00:12:52,530 --> 00:12:53,730 So if I will. 198 00:12:53,730 --> 00:12:56,190 Right, Roy equals rule plus step. 199 00:12:58,370 --> 00:12:59,280 So this is nothing. 200 00:12:59,300 --> 00:13:06,530 It is simply rule plus plus, OK, and if the value of a step is minus one, then what is the scenario? 201 00:13:06,800 --> 00:13:13,910 And I am writing requested or please step, then this line will become a rule minus minus if the value 202 00:13:13,910 --> 00:13:15,110 of a step is minus one. 203 00:13:15,590 --> 00:13:16,850 OK, simple. 204 00:13:17,060 --> 00:13:22,420 So to do this rule plus plus 10 and then again moving upward. 205 00:13:23,240 --> 00:13:28,250 So we have to do two plus plus and we have to do two minus minus for doing this plus plus this minus 206 00:13:28,250 --> 00:13:28,740 minus thing. 207 00:13:29,030 --> 00:13:34,540 I am keeping, I'm maintaining a variable step which is initially one because we have to move down initially, 208 00:13:34,580 --> 00:13:42,140 OK, and then we will reach here when we will reach at the last index I will update the value of a step 209 00:13:42,140 --> 00:13:43,150 to become minus one. 210 00:13:43,460 --> 00:13:47,470 Then when I will do roll cultural step this will become room minus minus. 211 00:13:47,480 --> 00:13:48,500 OK, simple. 212 00:13:51,080 --> 00:13:56,840 So I have to push at the next rule, OK, so this is basically a string and for pushing the element 213 00:13:56,840 --> 00:13:58,880 inside the string, we have a function push back. 214 00:14:00,440 --> 00:14:03,950 Push back and you can give the character so characters basically Astolfi. 215 00:14:06,010 --> 00:14:13,600 OK, so now what we have to do, so either I have to move down through placeless or I have to move up 216 00:14:13,600 --> 00:14:14,710 room minus minus. 217 00:14:15,020 --> 00:14:16,770 OK, so how to decide? 218 00:14:16,780 --> 00:14:17,270 Let's see. 219 00:14:17,530 --> 00:14:22,900 So basically, I will simply ride equals rule plus step. 220 00:14:23,800 --> 00:14:25,000 And now let us check. 221 00:14:25,010 --> 00:14:26,140 Either we have to move. 222 00:14:27,200 --> 00:14:29,190 Either we have to appreciate the value of step or not. 223 00:14:29,570 --> 00:14:34,760 So if basically I am standing at zero zero, then obviously I have to move down. 224 00:14:35,150 --> 00:14:40,550 So if I have to move down, so I will step backwards one so that it will become a hopeless place. 225 00:14:40,760 --> 00:14:46,040 So this is where the value of step is when this will become rouble's plus. 226 00:14:48,290 --> 00:14:49,520 OK, and. 227 00:14:50,930 --> 00:14:55,760 If I'm at the last index, OK, so elusive. 228 00:14:57,390 --> 00:15:01,230 I am at the last index of the array, so basically ROI equals equals. 229 00:15:02,830 --> 00:15:04,000 And those minus one. 230 00:15:05,870 --> 00:15:11,000 The last minutes of the day, you can see that it is of size and those so the last index is basically 231 00:15:11,000 --> 00:15:15,380 and minus one, if I am standing at the Lastra next, then I have to move up. 232 00:15:15,610 --> 00:15:20,420 OK, so for moving up, the value of step should be minus one. 233 00:15:21,810 --> 00:15:25,620 OK, so this is to move up roominess minus. 234 00:15:26,910 --> 00:15:27,930 We have to move up. 235 00:15:28,950 --> 00:15:31,860 And this is simply Roy Chloroplast. 236 00:15:32,070 --> 00:15:38,640 OK, so when we will reach the end of the for loop, our ETA is basically ready. 237 00:15:38,970 --> 00:15:40,230 So this Eddie. 238 00:15:40,320 --> 00:15:44,160 OK, so this area is basically ready then. 239 00:15:44,160 --> 00:15:49,470 What I have to do, I have to create a string and I just have to rotate over this area and I have to 240 00:15:49,470 --> 00:15:49,890 append. 241 00:15:51,080 --> 00:15:54,530 These strings, OK, now let's create. 242 00:15:56,490 --> 00:15:59,070 A variable answer which is initially empty. 243 00:15:59,220 --> 00:16:02,190 OK, now we have to hydrate. 244 00:16:03,350 --> 00:16:04,230 Over this area. 245 00:16:04,970 --> 00:16:08,080 OK, this area is basically ready in order to saturate all this area. 246 00:16:13,000 --> 00:16:18,970 And what we have to do, so on so goes on surplus, so this surplus operator can append two strings. 247 00:16:19,240 --> 00:16:21,490 OK, so answer a question surplus. 248 00:16:21,490 --> 00:16:24,720 The name of that is a and the indexers I. 249 00:16:24,840 --> 00:16:31,180 OK, and when we will reach when we come out of the loop, we can return our answer. 250 00:16:31,520 --> 00:16:31,900 OK. 251 00:16:36,920 --> 00:16:39,160 OK, so Alcalde is working now legitimate. 252 00:16:42,450 --> 00:16:48,990 OK, so our goal is working fine, nobody can do so instead of creating this, and I don't think we 253 00:16:48,990 --> 00:16:50,890 can, like, update this thing also. 254 00:16:50,950 --> 00:16:54,500 OK, so do not create the new string. 255 00:16:54,510 --> 00:16:56,620 Let us update the previous one only. 256 00:16:56,670 --> 00:16:57,900 OK, so. 257 00:16:59,920 --> 00:17:06,310 This is so SMPTE empty, so I have a bit of this ring and then I'm updating the string. 258 00:17:06,310 --> 00:17:07,240 So Ezequiel's. 259 00:17:09,490 --> 00:17:14,140 Explicit, and then I am returning as OK, so I'm not getting news. 260 00:17:14,470 --> 00:17:16,300 I, I'm just updating the Gülen string. 261 00:17:19,520 --> 00:17:25,880 OK, so now let us discuss the time and the space complexity for our solution. 262 00:17:26,150 --> 00:17:27,290 OK, so one thing first. 263 00:17:28,010 --> 00:17:32,210 So what I'm doing here is so this is the input string, so I'm updating the input. 264 00:17:32,480 --> 00:17:34,190 I'm not getting any of the string, OK. 265 00:17:34,210 --> 00:17:35,450 So Ezequiel's and pretty. 266 00:17:36,800 --> 00:17:40,590 OK, you can also write I have a function clearance, so it's not clear. 267 00:17:41,060 --> 00:17:44,040 So this clear function and this empathy thing, they both seem. 268 00:17:44,270 --> 00:17:46,490 OK, so the space complexity. 269 00:17:47,620 --> 00:17:50,990 Basically, what we are doing, so we are creating a new area. 270 00:17:51,220 --> 00:17:52,740 OK, so we are creating this area. 271 00:17:52,870 --> 00:17:55,090 So the space complexities basically endless. 272 00:17:57,310 --> 00:18:04,990 Often less than the number of rules, OK, and the time complexities, basically, we are just trading 273 00:18:05,000 --> 00:18:05,710 over the string. 274 00:18:05,920 --> 00:18:10,110 OK, so here we are just trading over this string of the given string. 275 00:18:10,120 --> 00:18:13,150 So this is our Draffin Plus. 276 00:18:13,330 --> 00:18:16,810 And then we are trading over this new area. 277 00:18:16,870 --> 00:18:18,630 OK, we are trading over this new area. 278 00:18:18,640 --> 00:18:26,110 So the time, complexities and rules, because the sizes and complexity is basically order of N and 279 00:18:26,110 --> 00:18:27,260 order of andrews'. 280 00:18:28,870 --> 00:18:31,330 OK, so this thing will be very small. 281 00:18:31,360 --> 00:18:34,600 This will be like eight, three, four, five or six. 282 00:18:34,930 --> 00:18:36,610 But this will be very, very large. 283 00:18:36,640 --> 00:18:38,140 For example, this can be handled. 284 00:18:38,440 --> 00:18:40,280 This can be like a thousand characters. 285 00:18:40,300 --> 00:18:42,890 This can be 10000 Denki and so on. 286 00:18:43,210 --> 00:18:50,410 So basically PN is greater than goaltend and is much, much bigger than the number of rows you can see 287 00:18:50,440 --> 00:18:51,750 the time complexity is nothing. 288 00:18:51,760 --> 00:18:53,470 It is just big off and on. 289 00:18:53,720 --> 00:18:58,170 OK, so this is the time, complexity and also the number of rules. 290 00:18:58,180 --> 00:19:01,380 This will be basically like either one or two or three. 291 00:19:01,390 --> 00:19:03,070 So this really will be very, very small. 292 00:19:03,070 --> 00:19:04,020 Four, five, six. 293 00:19:04,190 --> 00:19:05,500 Generally this will be very, very small. 294 00:19:05,830 --> 00:19:10,670 So you can also say, like my space where complexity is nothing, it is just order one. 295 00:19:10,870 --> 00:19:14,860 OK, you can see because these values will be very, very small. 296 00:19:16,290 --> 00:19:18,340 OK, so you can see the space complex. 297 00:19:18,360 --> 00:19:23,280 It is a rough one, and if you are not comfortable with this, then you can see the space complexities, 298 00:19:23,910 --> 00:19:27,600 big number of rules and the time complexities big often. 299 00:19:28,430 --> 00:19:31,650 OK, so this was simply an implementation problem. 300 00:19:32,070 --> 00:19:35,010 OK, so if you have any doubt in this question, you can ask me. 301 00:19:35,010 --> 00:19:35,730 OK, thank you.