1 00:00:00,510 --> 00:00:11,220 Now, after this, we are supposed to define another function, that is to add letters to mapping is 2 00:00:11,220 --> 00:00:13,350 one, mapping one. 3 00:00:13,380 --> 00:00:24,460 And in this we are passing selective mapping one five for war one and candidate one. 4 00:00:24,990 --> 00:00:27,210 All these parameters we are passing here. 5 00:00:27,390 --> 00:00:33,350 And in this mapping, one parameter takes a dictionary value that basically stool's decide Falletta 6 00:00:33,480 --> 00:00:39,330 one mapping and which is copied by the function to decipher what one parameter is a street value of 7 00:00:39,330 --> 00:00:41,520 the ciphertext and the candidate. 8 00:00:41,520 --> 00:00:46,200 One parameter is a possible English word that cipher mode one would decrypt. 9 00:00:46,830 --> 00:00:53,580 So this particular function asks the letters in the candidate one as potential decryption letters, 10 00:00:53,790 --> 00:00:57,230 four of four letters, one in this letter mapping. 11 00:00:57,420 --> 00:01:06,720 So over here we are seeing four even in the range and we're giving you the range of the length of Civil 12 00:01:07,050 --> 00:01:07,980 War one. 13 00:01:08,770 --> 00:01:18,120 OK, and in this we are checking if the candidate one and the index of each one, if it is not in the 14 00:01:19,560 --> 00:01:29,480 letter mapping one in the bracket or the object of C Saiful one over the one at the next one. 15 00:01:29,550 --> 00:01:32,190 OK, so that is not in the mapping of this. 16 00:01:32,580 --> 00:01:44,060 Then let's close this and colon now in this we are giving that letter mapping one in the index of Saiful 17 00:01:44,130 --> 00:01:44,640 World one. 18 00:01:45,350 --> 00:01:54,620 Even now in this we are using a pen and we are upending the value of candidate one index either. 19 00:01:54,870 --> 00:01:55,190 OK. 20 00:01:56,170 --> 00:02:05,080 Fine now after definition for this particular function, let us go back here and redefine another matter 21 00:02:05,380 --> 00:02:10,700 that is to intersect mapping or mapping. 22 00:02:10,710 --> 00:02:10,930 So. 23 00:02:11,470 --> 00:02:18,050 And here we are passing the map over and map V1 as two parameters. 24 00:02:18,370 --> 00:02:25,450 Now, here to intersect the two maps, we are creating a blank map and then add only a potential decryption 25 00:02:25,450 --> 00:02:28,150 letters if they exist on both the maps. 26 00:02:28,180 --> 00:02:31,300 So in this we are creating the intersected. 27 00:02:34,090 --> 00:02:43,750 Mapping one, that's to we have another object that we will be creating, said that Blank Saiful. 28 00:02:45,360 --> 00:02:51,120 Let us know that we have already created a mapping one, so we are calling that you're getting all the 29 00:02:51,120 --> 00:02:57,090 blanks for little mappings from this particular function, storing it in the Intersect or intersected, 30 00:02:57,090 --> 00:03:06,840 mapping one object, and then we run a loop, seeing four letters, one in letters is the constant that 31 00:03:06,840 --> 00:03:08,920 we have created on the first line. 32 00:03:08,970 --> 00:03:11,780 So an empty list means any little as possible. 33 00:03:11,790 --> 00:03:14,760 So in this case, just copy another map and diary. 34 00:03:15,180 --> 00:03:25,440 So in this case, we are seeing if our map is one in the index of little one is equal to blank, then 35 00:03:26,070 --> 00:03:36,390 open the object and we see the intersected mapping one index of what we are using the copy matter, 36 00:03:36,660 --> 00:03:40,860 copy, dot the copy and we are giving him an object. 37 00:03:40,860 --> 00:03:44,190 Might be one index of little one. 38 00:03:45,510 --> 00:03:53,060 Now here we also will have the elusive path wherein we are checking if map B one at the index of little 39 00:03:53,070 --> 00:03:55,470 one, if that is equal to blank. 40 00:03:55,630 --> 00:04:06,720 If it is, then we say here see intersected mapping one index of Lepka one and now we are using copy 41 00:04:06,720 --> 00:04:14,600 dot the copy matter and copying the object of each one at the index of later on in this. 42 00:04:14,900 --> 00:04:22,290 OK, now if both of this falls then we are going to spot any four letter and map A1 at the index of 43 00:04:22,290 --> 00:04:25,380 letters is existing and B one of the index of little one. 44 00:04:25,680 --> 00:04:29,370 Then add that letter to the intercepted mappings of Legalman. 45 00:04:29,670 --> 00:04:40,370 So here we are checking for C mapped like the one in map even index legalman. 46 00:04:41,190 --> 00:04:48,000 Then in this you check if over mapped letter is in. 47 00:04:48,720 --> 00:04:52,650 Also Map B one at the index of Lietuva. 48 00:04:53,040 --> 00:05:02,790 If both the conditions are true, then you'll see in the intersected mapping one at the index of letter 49 00:05:02,850 --> 00:05:09,150 one, we are seeing DOT in the value of mapped letter one. 50 00:05:10,050 --> 00:05:18,810 OK, and after you have done this, do not forget to use a written statement and say return the intersected 51 00:05:20,880 --> 00:05:22,010 mapping one. 52 00:05:22,800 --> 00:05:28,590 And once you have written the particular value, then the method ends and we come to another method 53 00:05:28,590 --> 00:05:32,550 definition that is removing these old letters from mapping. 54 00:05:32,820 --> 00:05:36,780 So now let us define how the function letters. 55 00:05:37,080 --> 00:05:38,070 So remove. 56 00:05:39,030 --> 00:05:52,670 Solved letters from mapping one, and it will be the object as little mapping one once you have passed 57 00:05:52,680 --> 00:05:53,290 the object. 58 00:05:53,530 --> 00:06:00,660 Now in this deciphered letters in the mapping, that map to only one letter are solved and can be removed 59 00:06:00,660 --> 00:06:01,660 from other letters. 60 00:06:01,860 --> 00:06:08,580 So, for example, save a map still potentially does a man and and B maps to n then we know that we 61 00:06:08,580 --> 00:06:10,080 must be map to enemy. 62 00:06:10,320 --> 00:06:10,680 Right. 63 00:06:10,830 --> 00:06:14,190 So we can then remove and from the list of what a good map. 64 00:06:14,460 --> 00:06:16,370 So then a map to Emily. 65 00:06:16,560 --> 00:06:22,710 So know that now that maps only one letter, we can remove them from the list of letters for every other 66 00:06:22,710 --> 00:06:23,040 letter. 67 00:06:23,160 --> 00:06:29,250 So this is why there is a loop which we keep on reducing the map in this particular method that we would 68 00:06:29,250 --> 00:06:30,110 be creating. 69 00:06:30,660 --> 00:06:37,290 OK, now we would be creating a variable loop again, one which is initially equal to through. 70 00:06:37,890 --> 00:06:45,780 Then we say via the loop again, one, which means while it is true, we are assuming that we will not 71 00:06:45,780 --> 00:06:46,450 loop again. 72 00:06:46,560 --> 00:06:50,820 So we are giving here a loop again is equal to Foote's. 73 00:06:51,420 --> 00:06:57,030 Then the fourth letters we will be list or will be basically the list of your uppercase letters that 74 00:06:57,030 --> 00:07:00,060 have one and only one possible map to the letter mappings. 75 00:07:00,450 --> 00:07:10,110 So here we are creating C solved letters that's equal to blank. 76 00:07:10,110 --> 00:07:20,430 Initially we say while the cipher letters is equal to or in the letters Astraea, 77 00:07:24,450 --> 00:07:38,520 then we are seeing if the length of your letter mapping one at the index of your cipher letter one and 78 00:07:39,180 --> 00:07:39,720 zero. 79 00:07:40,020 --> 00:07:43,720 OK, so we are giving the two indexes that is zero and the column. 80 00:07:43,810 --> 00:07:52,770 OK, and in this one thing you made a mistake here or we are forced checking there for SICI Fullarton 81 00:07:52,860 --> 00:07:53,670 in letters. 82 00:07:53,940 --> 00:07:58,650 Then we check if the letter mapping one saw the index of your cipher letter. 83 00:07:58,980 --> 00:08:04,080 If that is equal to one then we are saying see these solved 84 00:08:06,900 --> 00:08:14,770 letters one dot, we are using your append and giving little mapping one. 85 00:08:15,180 --> 00:08:16,850 Now we are giving two indexes. 86 00:08:16,860 --> 00:08:21,240 One is Saifullah to one, another is zero. 87 00:08:22,380 --> 00:08:22,800 OK.