1 00:00:01,690 --> 00:00:02,320 Hi, everyone. 2 00:00:02,350 --> 00:00:08,330 So in this lesson, we are going to solve this question, remove duplicates, inanity, so this example. 3 00:00:08,350 --> 00:00:12,060 So this is basically and ready and what we have to do. 4 00:00:12,310 --> 00:00:17,600 So basically we have to return a veteran of integers and in this kind of integers. 5 00:00:18,000 --> 00:00:19,680 So this is the vector. 6 00:00:19,840 --> 00:00:23,170 So in this integers element will appear only once. 7 00:00:23,740 --> 00:00:26,590 They will be all unique elements inside this vector. 8 00:00:26,830 --> 00:00:27,760 So let me show you. 9 00:00:28,060 --> 00:00:30,910 I would put one it here then to. 10 00:00:32,140 --> 00:00:32,800 Then three. 11 00:00:33,890 --> 00:00:39,810 Then, too, is coming again, so, too, is already present inside the Taketo then when so when it 12 00:00:39,830 --> 00:00:41,210 already present, take five. 13 00:00:42,360 --> 00:00:43,350 You're going to take for. 14 00:00:44,520 --> 00:00:49,560 You cannot take one because one is already present and you cannot take three because he's already poisoned, 15 00:00:49,740 --> 00:00:51,120 so this will be my output. 16 00:00:51,180 --> 00:00:54,410 OK, so one, two, three, five and four. 17 00:00:54,690 --> 00:00:55,890 So if you will notice. 18 00:00:55,890 --> 00:00:59,370 So this vector is basically containing all unique elements. 19 00:01:00,610 --> 00:01:05,470 So that is the meaning of removing duplicates, so in this area, duplicates are present, but it will 20 00:01:05,470 --> 00:01:06,160 see the vector. 21 00:01:06,520 --> 00:01:08,170 All elements are unique elements. 22 00:01:08,320 --> 00:01:12,970 And one more thing to notice, elements are appearing in the same order by same order. 23 00:01:13,000 --> 00:01:17,130 I mean, so one is coming before two in the original also. 24 00:01:17,140 --> 00:01:18,540 So one was before two. 25 00:01:18,730 --> 00:01:24,570 Similarly, five is coming before four because in the original Eddie five was coming before four. 26 00:01:24,790 --> 00:01:26,800 So that is the meaning of same order. 27 00:01:27,340 --> 00:01:29,510 So what we have to do so given this integer Eddie. 28 00:01:30,500 --> 00:01:36,170 We have to find this vector, we have to generate this vector that will contain all the unique elements 29 00:01:36,170 --> 00:01:37,610 and in the same order. 30 00:01:38,900 --> 00:01:40,860 Now let's see how we can solve this question. 31 00:01:41,210 --> 00:01:43,380 So when you're solving this question is very simple. 32 00:01:43,400 --> 00:01:44,240 So what do you do? 33 00:01:44,480 --> 00:01:48,540 You pick one element and then you will search whether this element or not. 34 00:01:48,620 --> 00:01:50,330 If it is not present, then you will push. 35 00:01:50,600 --> 00:01:54,410 Similarly, the second element check it is present inside the vector. 36 00:01:54,410 --> 00:01:58,820 Not if it is not present, then you can push a device, not push similarly. 37 00:01:59,180 --> 00:02:00,200 But the third element. 38 00:02:00,200 --> 00:02:03,530 And then I read all the vector and check whether it is present or not present. 39 00:02:03,770 --> 00:02:09,590 So in this we will be able to solve this question now with the time complexity, if we will use this 40 00:02:09,590 --> 00:02:09,970 approach. 41 00:02:10,580 --> 00:02:11,060 So. 42 00:02:13,030 --> 00:02:16,690 So this is my indigeneity, this input, so this is an area. 43 00:02:17,860 --> 00:02:23,560 And if you will follow the above approach, so whatever time complexity, so this is my vector, so 44 00:02:23,560 --> 00:02:25,480 initiate the vector is containing zero elements. 45 00:02:25,780 --> 00:02:30,170 So you pick the first element, you will check that is empty so you can push this element. 46 00:02:30,430 --> 00:02:34,200 So when work is done now, pick the second element. 47 00:02:34,330 --> 00:02:37,870 So you will like to order Vector to check whether this element is present or not. 48 00:02:38,140 --> 00:02:38,980 So basically. 49 00:02:40,260 --> 00:02:45,270 The amount of Ogborn, similarly, you will pick the third element, so you will agree to whatever it 50 00:02:45,270 --> 00:02:46,090 is, pleasant or not. 51 00:02:46,350 --> 00:02:48,420 Similarly for the net element, so. 52 00:02:49,600 --> 00:02:56,170 For the entertainment, what do you have to read over the computer to check whether the element is present 53 00:02:56,170 --> 00:03:01,210 or not so invoke, you have to perform and work because you have to write it or the computer actor to 54 00:03:01,210 --> 00:03:03,100 check whether this element is present or not. 55 00:03:03,520 --> 00:03:05,050 So what does the time complexity. 56 00:03:05,070 --> 00:03:06,460 So if you will add all this. 57 00:03:08,060 --> 00:03:13,930 So and plus and minus one, plus and minus two, it will go until one and we know. 58 00:03:13,980 --> 00:03:17,470 So this is basically off and square and big off and square. 59 00:03:17,690 --> 00:03:19,280 So time complexities. 60 00:03:19,610 --> 00:03:20,780 Big off and square. 61 00:03:22,260 --> 00:03:24,750 Now, how can we optimize our time complexity? 62 00:03:25,470 --> 00:03:31,050 So basically what we are doing, we are picking one element and then we are searching over the computer 63 00:03:31,050 --> 00:03:33,840 vector to check whether the element is present or not. 64 00:03:34,050 --> 00:03:36,810 So if we can perform the searching in Question Time. 65 00:03:38,030 --> 00:03:43,820 If he can perform this routine constant, then our time complexity will become so picking every element 66 00:03:43,820 --> 00:03:47,540 and then checking whether it is present or not so and multiply one. 67 00:03:47,570 --> 00:03:53,600 So that means the time complexity will become linear if we can do the searching in the vector in constant 68 00:03:53,600 --> 00:03:53,830 time. 69 00:03:54,440 --> 00:03:55,870 So here, what is it? 70 00:03:55,870 --> 00:03:56,590 Time, complexity. 71 00:03:56,600 --> 00:04:02,040 So you are picking each and every element and then you have to search inside the vector so and multiply. 72 00:04:02,060 --> 00:04:06,550 And so this is for picking every element and this is for searching inside the vector. 73 00:04:06,920 --> 00:04:14,210 But I am saying if we can perform the search in Question Time so the time complexity will become linear 74 00:04:15,170 --> 00:04:21,410 because and and how we can check in Question Time, basically we can use we can take the help of MAP 75 00:04:21,410 --> 00:04:25,580 because in map searching is constraint time and certainly search. 76 00:04:25,580 --> 00:04:29,420 All three operations are constant in an order to map. 77 00:04:29,990 --> 00:04:36,530 If you will use the map, then insert, delete, search, all your patients will take longer time. 78 00:04:36,740 --> 00:04:38,360 So in this question, what do we lose? 79 00:04:38,810 --> 00:04:40,110 We will lose in order to map. 80 00:04:41,180 --> 00:04:43,850 Now many people can say, why does it matter? 81 00:04:43,880 --> 00:04:48,230 We can also solve this question with the help of Eddie, so how we can solve this question with the 82 00:04:48,230 --> 00:04:48,770 help of Eddie. 83 00:04:49,010 --> 00:04:50,570 So consider this example only. 84 00:04:51,970 --> 00:04:56,150 So what do you do, you will find out the maximum, so five is the maximum element. 85 00:04:56,380 --> 00:05:01,720 And now what you'll do after find out the maximum element, you will make an array of size five plus 86 00:05:01,720 --> 00:05:01,960 one. 87 00:05:02,560 --> 00:05:05,740 So five is the maximum element to make an area of size five plus one. 88 00:05:06,040 --> 00:05:08,170 So the size of that, it will be five, six. 89 00:05:08,770 --> 00:05:09,700 This is five. 90 00:05:09,700 --> 00:05:10,450 And this is zero. 91 00:05:11,050 --> 00:05:13,920 And basically this area will be a bowling alley roof area. 92 00:05:14,440 --> 00:05:15,390 Now, what do you do? 93 00:05:15,850 --> 00:05:17,350 You will check when it's present. 94 00:05:17,620 --> 00:05:21,990 So inside when initially this area will be initialized with false. 95 00:05:22,030 --> 00:05:23,590 So I will check when I go to one. 96 00:05:23,770 --> 00:05:24,520 It is false. 97 00:05:24,730 --> 00:05:27,440 So basically you can push it inside the vector and make it through. 98 00:05:28,000 --> 00:05:32,570 No, if the next time when will come, you will see here you will check or Wennerstrom. 99 00:05:32,590 --> 00:05:34,360 So do not push inside the vector. 100 00:05:34,600 --> 00:05:36,490 So definitely you can use this approach. 101 00:05:37,600 --> 00:05:41,680 Let's take one more example, for example, three, so I will check, you will go to three. 102 00:05:41,830 --> 00:05:46,310 So initially, this building that is initialized with force, you will check all three is false. 103 00:05:46,310 --> 00:05:47,260 So you will push three. 104 00:05:47,500 --> 00:05:50,790 But the next time three will appear and we will also make it through. 105 00:05:51,490 --> 00:05:54,610 We will also make it through after pushing inside the vector, we will make it through. 106 00:05:54,640 --> 00:05:59,080 So when the next time things are coming, you will go to the next three and you will check No. 107 00:05:59,180 --> 00:05:59,800 Three, Drew. 108 00:06:00,250 --> 00:06:02,920 So basically you will not push inside the vector again. 109 00:06:03,220 --> 00:06:05,070 So we can definitely use this approach. 110 00:06:05,080 --> 00:06:13,000 We can definitely take the help of Belinelli, but the problem is considered you had in error is basically 111 00:06:13,000 --> 00:06:13,810 of this size. 112 00:06:14,470 --> 00:06:21,370 It is containing elements of this type then then then to power three then then to power six then then 113 00:06:21,370 --> 00:06:22,730 to power seven and so on. 114 00:06:23,200 --> 00:06:24,130 So what you have to do. 115 00:06:25,220 --> 00:06:30,200 If you will follow this approach, what is the maximum limit, so 10 to the power seven is the maximum 116 00:06:30,200 --> 00:06:32,390 limit and obviously the elements are debating. 117 00:06:32,720 --> 00:06:36,200 So then the power three, then to power six, then again, tend to power seven. 118 00:06:36,560 --> 00:06:39,710 Obviously, there are duplicates now in order to you. 119 00:06:40,010 --> 00:06:43,260 So I'll just caution using this method, this is the maximum limit. 120 00:06:43,520 --> 00:06:48,660 So basically the size of the area, the billionaire will be able to sustain to power seven plus one. 121 00:06:48,980 --> 00:06:50,960 So this will be your alley now. 122 00:06:50,990 --> 00:06:52,460 This is very huge. 123 00:06:52,460 --> 00:06:55,720 Speace, very, very huge, huge space. 124 00:06:56,600 --> 00:06:57,840 OK, so this is wrong. 125 00:06:58,880 --> 00:06:59,750 Now, one more thing. 126 00:07:00,470 --> 00:07:02,120 The elements can be negative also. 127 00:07:03,820 --> 00:07:06,430 Integer can be negative, so I can have minus 10. 128 00:07:06,580 --> 00:07:12,770 So how can you store minus 10 here, minus 10 index does not exist, minus 10 index will not exist. 129 00:07:12,940 --> 00:07:16,270 So that means this approach has a lot of limitations. 130 00:07:16,960 --> 00:07:22,120 If that is basically off, if there is containing elements of these types and also if that is containing 131 00:07:22,120 --> 00:07:25,160 negative element, then you cannot use this approach. 132 00:07:25,870 --> 00:07:28,400 So basically we have to use map in this case. 133 00:07:29,080 --> 00:07:31,930 Now, if you are using map, you can definitely do something like this. 134 00:07:32,620 --> 00:07:36,070 My map of minus five is true. 135 00:07:36,340 --> 00:07:37,840 You can definitely do something like this. 136 00:07:37,860 --> 00:07:46,150 Similarly, you can do my map of to power seven is true, not my map of 10000. 137 00:07:46,150 --> 00:07:49,180 Doesn't mean that your map is often to power seven sites. 138 00:07:50,050 --> 00:07:56,830 We will see the implementation map will take very, very small space maps will take very, very small 139 00:07:56,830 --> 00:07:57,190 space. 140 00:07:57,500 --> 00:08:00,840 So it doesn't mean the size of the map will return to power. 141 00:08:00,850 --> 00:08:04,590 So no, it will be very, very, very, very large as compared to the areas. 142 00:08:06,160 --> 00:08:07,290 And one more thing. 143 00:08:07,330 --> 00:08:09,060 So this is in digit area. 144 00:08:09,880 --> 00:08:14,740 So we are talking about indigeneity now in the question if there was connectivity. 145 00:08:16,860 --> 00:08:23,760 If there was crack berry, for example, if there was characters like it, then C, C, then D, B, 146 00:08:24,030 --> 00:08:28,790 so if instead of a degenerate character it was given, then definitely what can do. 147 00:08:28,800 --> 00:08:31,080 You can make an array of size 256. 148 00:08:32,500 --> 00:08:34,510 And obviously, this area will be a billionaire. 149 00:08:35,630 --> 00:08:37,850 And you can use this approach, for example. 150 00:08:38,020 --> 00:08:41,850 So go to index 97, so initially this was false. 151 00:08:41,960 --> 00:08:44,330 What you will do, so you will see false. 152 00:08:44,450 --> 00:08:47,300 You will push inside the vector and then you will make it through. 153 00:08:47,720 --> 00:08:50,860 Similarly, when you will come again, you will go to index 97. 154 00:08:50,870 --> 00:08:51,640 So this is true. 155 00:08:51,650 --> 00:08:53,970 Then do not push it again, see? 156 00:08:54,320 --> 00:08:58,820 So go to index ninety seven ninety nine and it will check. 157 00:08:58,820 --> 00:08:59,450 It is false. 158 00:08:59,480 --> 00:09:02,370 So you will make it through, you will push AC and so on. 159 00:09:02,630 --> 00:09:06,710 So basically if the correct area was given you can definitely use this boolean area approach. 160 00:09:06,980 --> 00:09:11,670 But since we have in beta that an integer can be very big and indeed it can be negative also. 161 00:09:11,690 --> 00:09:17,480 So we have to use map in this question so that our time complexity can be linear. 162 00:09:19,000 --> 00:09:20,590 OK, so how can we use map? 163 00:09:20,600 --> 00:09:24,550 So it is very, very simple, so considered a very small example. 164 00:09:24,730 --> 00:09:26,290 So consider above an example. 165 00:09:27,190 --> 00:09:30,370 So what we will do so I have this goes like this in your area. 166 00:09:30,380 --> 00:09:35,770 So one, two, three, then two, then one, then let's say five for one and three. 167 00:09:36,430 --> 00:09:37,190 So what will do? 168 00:09:37,540 --> 00:09:39,130 I am going to construct a map. 169 00:09:39,130 --> 00:09:41,200 So let's say the name of map is my map. 170 00:09:41,860 --> 00:09:47,080 Give a key will be element and there will be basically true or false. 171 00:09:48,100 --> 00:09:50,650 So what we will do so pick the first element. 172 00:09:50,650 --> 00:09:51,940 Not so initially. 173 00:09:51,940 --> 00:09:52,840 My map is empty. 174 00:09:52,870 --> 00:09:53,680 So this is map. 175 00:09:55,960 --> 00:10:00,660 So initially, members is empty, no check, so one percent inside the map, no, it is not present. 176 00:10:00,670 --> 00:10:04,320 So what you will do, you will push one and one or two. 177 00:10:04,360 --> 00:10:08,830 So the value of one is true and it will push one inside the vector now, too. 178 00:10:09,310 --> 00:10:10,930 So to present inside the map. 179 00:10:10,930 --> 00:10:11,240 No. 180 00:10:11,410 --> 00:10:14,730 So push two and make it through now three. 181 00:10:14,740 --> 00:10:16,150 So three plus inside the map. 182 00:10:16,150 --> 00:10:16,440 No. 183 00:10:16,780 --> 00:10:18,790 Then push inside the map and make it through. 184 00:10:19,270 --> 00:10:23,710 So obviously when you will push inside the map we will also push inside the vector. 185 00:10:23,710 --> 00:10:25,510 So you will also push inside the vector. 186 00:10:26,260 --> 00:10:28,780 So this is the vector that we have to return. 187 00:10:28,810 --> 00:10:31,150 OK, now again, two is coming. 188 00:10:31,330 --> 00:10:33,280 So two is already present inside the map. 189 00:10:33,280 --> 00:10:34,990 So do not do anything one. 190 00:10:35,170 --> 00:10:37,060 So one is already inside the map. 191 00:10:37,060 --> 00:10:37,850 Do not do anything. 192 00:10:38,290 --> 00:10:39,820 Five five is not president. 193 00:10:39,850 --> 00:10:46,870 Then you will push five inside the map and you will also push five inside the vector then four. 194 00:10:47,020 --> 00:10:52,630 So far it is not pleasant inside the map, so you will make it through and they will push for inside 195 00:10:52,630 --> 00:10:53,140 the vector. 196 00:10:53,650 --> 00:10:57,490 Then again, one so one is present then three. 197 00:10:58,000 --> 00:11:00,370 So Ts present and this will be your answer. 198 00:11:01,380 --> 00:11:07,650 This will be, Warren said, OK, so searching in map, so we will use dart count function as discussed 199 00:11:07,650 --> 00:11:08,540 in the previous video. 200 00:11:08,760 --> 00:11:11,650 So this time complexity of current function is constant. 201 00:11:11,700 --> 00:11:16,620 If you are using an order to map and if you are using map, then the time complexity will be log-in. 202 00:11:17,640 --> 00:11:22,950 So we will use on our road map so that time complexity is constrained, so with the help of MAP, we 203 00:11:22,950 --> 00:11:24,580 can solve this question in linear time. 204 00:11:25,590 --> 00:11:27,510 Now, let us write the code for discussion. 205 00:11:27,690 --> 00:11:29,790 A piece of code is going to look very, very simple. 206 00:11:32,410 --> 00:11:39,400 So what we have to do, we have to return our function will return basically vector of integers and 207 00:11:39,400 --> 00:11:42,400 let's say the name of the function is basically remove duplicates. 208 00:11:44,490 --> 00:11:50,910 So what will take so this function will take and that is input and obviously it will take size also. 209 00:11:52,970 --> 00:11:57,290 And then do you have to do so, let us first create our vector of. 210 00:11:58,940 --> 00:12:04,970 So first, let us create our output vector of integers and output so it will contain all the unique 211 00:12:04,970 --> 00:12:06,420 elements and in the same order. 212 00:12:07,010 --> 00:12:09,440 And now let us also create an order to map. 213 00:12:11,360 --> 00:12:12,650 So key will be element. 214 00:12:14,660 --> 00:12:15,750 It will be deja. 215 00:12:17,120 --> 00:12:20,100 And they will be basically boolean value, true or false? 216 00:12:20,690 --> 00:12:22,790 And let's see the name of my is my map. 217 00:12:24,020 --> 00:12:30,950 So you can see yourself, so the structure of my map is very simple, give a loopier. 218 00:12:30,950 --> 00:12:36,510 So she's going to be element and element as integer and this is going to be true or false. 219 00:12:36,530 --> 00:12:40,700 So basically, boolean value key and integer and boolean. 220 00:12:42,410 --> 00:12:45,580 Initially my map is empty, then you have to do so. 221 00:12:45,850 --> 00:12:49,250 Now let us over the so I equals zero. 222 00:12:49,580 --> 00:12:51,140 I understand and I placeless. 223 00:12:53,020 --> 00:12:57,780 Now, first, let us search whether this element is present or not, so I will use common functions 224 00:12:57,780 --> 00:12:59,810 so my map does not count. 225 00:13:00,160 --> 00:13:02,220 So what it will take, it will take as input. 226 00:13:02,800 --> 00:13:04,920 Basically, Miss Element element is integer. 227 00:13:05,290 --> 00:13:07,870 So if if I equals equals zero. 228 00:13:08,620 --> 00:13:13,280 So I told you can't function will only return to things zero one zero means not present. 229 00:13:13,600 --> 00:13:18,080 So if the element is not present inside the map that means it is coming for the first time. 230 00:13:18,370 --> 00:13:24,580 So if it is coming for the first time, you will push it inside your vector because it is coming for 231 00:13:24,580 --> 00:13:25,300 the first time. 232 00:13:25,700 --> 00:13:26,950 So output push pushback. 233 00:13:27,760 --> 00:13:30,210 And also you will push it inside the map. 234 00:13:30,520 --> 00:13:33,310 So my map dart bush. 235 00:13:34,530 --> 00:13:38,280 --, my Amapa, and that's great because so Alphie. 236 00:13:39,840 --> 00:13:40,910 Is basically true. 237 00:13:42,410 --> 00:13:47,690 OK, so this is key and this is value, so Elfy is key and this is value. 238 00:13:47,700 --> 00:13:49,210 So if is true. 239 00:13:49,560 --> 00:13:53,310 And finally, what you can do, you can return your vector. 240 00:13:53,700 --> 00:13:55,140 So return output. 241 00:13:57,700 --> 00:14:01,420 Simple, now let us create an error here and let us do our program. 242 00:14:03,530 --> 00:14:05,590 So let's give the elemental. 243 00:14:09,820 --> 00:14:10,660 So this is the. 244 00:14:11,870 --> 00:14:14,540 Edit And now let us call the function. 245 00:14:17,590 --> 00:14:19,090 Selecter and outpoured. 246 00:14:20,140 --> 00:14:22,240 So the name of the function is remove duplicates. 247 00:14:26,700 --> 00:14:30,240 This function will take at as input and what is the size of the area? 248 00:14:30,410 --> 00:14:36,360 So two, one, two, three, four, five, six, seven, eight, nine, 10, 11 and 12. 249 00:14:36,360 --> 00:14:37,670 So they are total 12 element. 250 00:14:37,690 --> 00:14:38,830 So size of that is 12. 251 00:14:39,630 --> 00:14:46,040 And now let us bring our vector so that we can see the output so close to zero. 252 00:14:46,050 --> 00:14:46,770 I listin. 253 00:14:48,440 --> 00:14:49,460 Outpoured says. 254 00:14:51,250 --> 00:14:52,090 I placeless. 255 00:15:03,450 --> 00:15:06,810 No, first, before running this program, let's see what our output should be. 256 00:15:09,190 --> 00:15:14,530 So when when is coming for the first time, then five is going for the first time, two is coming for 257 00:15:14,530 --> 00:15:19,090 the first time, for what is coming for the first time, will not take this four, then three is coming 258 00:15:19,090 --> 00:15:19,840 for the first time. 259 00:15:20,940 --> 00:15:26,850 So we will not take this three, we will take six, we will also take seven, we will not take one and 260 00:15:26,850 --> 00:15:28,800 we will not take one, we will not take two. 261 00:15:29,040 --> 00:15:30,620 So they should be our answer. 262 00:15:32,190 --> 00:15:36,600 When five to four to six, seven one, five to four to six, seven Solarte. 263 00:15:37,570 --> 00:15:38,530 Yurtseven Applebaum. 264 00:15:40,500 --> 00:15:46,860 OK, so basically we have to include Victor, we have to include an order to map, so instead of including 265 00:15:46,860 --> 00:15:48,480 these two, we can write. 266 00:15:53,960 --> 00:15:55,280 So now let's on the program. 267 00:15:58,960 --> 00:16:00,850 OK, so my blood count. 268 00:16:02,170 --> 00:16:02,850 What is the idea? 269 00:16:02,900 --> 00:16:04,510 So if my map. 270 00:16:05,660 --> 00:16:07,230 Not Count Elfy. 271 00:16:07,610 --> 00:16:09,080 OK, so the name of that is. 272 00:16:10,160 --> 00:16:11,660 So let's change the name. 273 00:16:13,810 --> 00:16:14,920 The name is Enno. 274 00:16:19,520 --> 00:16:27,200 So this is the output when five, 246, seven, so our output is right as discussed when five to four 275 00:16:27,200 --> 00:16:27,830 to six, seven. 276 00:16:27,840 --> 00:16:31,220 So all the elements are unique and elements are appearing in the same order. 277 00:16:31,910 --> 00:16:35,060 Now, let us discuss what is the time complexity of a solution. 278 00:16:38,980 --> 00:16:44,470 Now, what we are doing here, so we are just editing all the data and basically the scoring function 279 00:16:44,470 --> 00:16:48,970 will be constrained by this pushback will take time and this inspection will take constant time. 280 00:16:49,210 --> 00:16:52,030 So our time complexity is basically linear. 281 00:16:53,120 --> 00:16:58,370 Now, if you are using map, so instead of using an order to map, if you will use map, then what will 282 00:16:58,370 --> 00:16:58,680 happen? 283 00:16:58,850 --> 00:17:03,920 So this current function will take a long time and social function will also take longer time. 284 00:17:04,069 --> 00:17:06,200 So time complexity will become and login. 285 00:17:08,240 --> 00:17:12,890 So this is the time complexity, if you will, use map, and this is the time complexity, if you will 286 00:17:12,890 --> 00:17:13,970 use an online map. 287 00:17:16,329 --> 00:17:21,280 And this is my output, so all the elements are unique and elements are appearing in the same order. 288 00:17:21,280 --> 00:17:26,940 So you can see when five, then two, then four and then three, six and seven. 289 00:17:27,160 --> 00:17:29,410 So one, five to four, three, six, seven. 290 00:17:29,740 --> 00:17:31,350 So I hope you understood this code. 291 00:17:32,020 --> 00:17:33,730 I hope you understood this question also. 292 00:17:34,960 --> 00:17:38,040 I will see you in the next one, and if you have any doubt, you can ask me. 293 00:17:38,440 --> 00:17:38,920 Thank you.