Now, the for loop go through all the twenty six possible cipher letters and looks at this, I followed
a map and a list of your potential decryption letters for this or for that cipher letter.
That is the list at the letter mappings at the index of Saiful Little One.
Then it checks whether the length is equal to or the length of this list is equal to one.
If it is, then we know that there is only one letter that this letter would decrypt to decipher letters.
So.
So then over here we are adding it to the sort of decryption letters to this all letters list and the
sort of letters always add letter mappings.
That is a four letter and they zero because it is a list of potential decryption letters that has only
one string in appendix zero of the list.
So after the previous for loop that has started the those that the variable should contain a list of
all the descriptions of cipher letters.
And at this point the program is done identifying all these old letters.
Then it checks whether they are listed as potential decryption letters for other cipher letters and
then remove them.
So for doing this, then we are having another for loop, which is going through all the possible twenty
six cipher letters and looks at this four letter mapping list of the potential decryption letters.
So here we are seeing four five letter one.
Illiteracy are four is one in this all four letters.
If the length of this is not equal to one and this is in your letter mappings, what are the index of
cipher letters then we are seeing the letter mapping one at the index of five letters.
One is not remove and then we check if it is equal to one.
And that is the new letter is now solved then.
So no loop again and making it loop again to prove it will again continue the loop.
So here before each side fully examines through the letters in this solve letters to check whether any
of them exist in the list of potential decryption letters for the mapping one at the index of cipher
letter one.
Then we check whether the list of potential decryption letters is then solved by checking whether the
length of letter mapping is one of the index of five letters.
One is not equal to one which is over here in this line.
And by checking whether this letter exists in the list of potential decryption letters.
So if both the criteria are met in this condition is returning through, then we remove that sulfur
letters from S1 from the list of potential decryption letters.
And if this removal leaves only one letter in the list of decryption letters, then we again said the
loop again, we're able to prove in this case so that the court can remove this newly solved letter
from the four letter mappings on the next iteration.
Now, after the Vilo has gone to a full iteration without the game being set to prove, then the program
moves beyond the loop and returns the SAIFULLAH to mapping that the letter mapping one over here and
the variable at mapping one should now contain a partial or potential full resolve cipher later mapping.
So now let's come to testing this particular method that is remove letter from mapping function.
So let's see this particular function in action.
Testing it in the interactive shell now will go back to Interactive Shell and where we have created
the intersected mappings.
So let us just cooperate on this function name, which is easy for us to write down over here.
Now we will see what he will see.
Letter mapping is equal to say, simple sub hackl dot this removal of letters from mapping one function
and in this we would be passing, say, the intersected mapping one in this case.
And then let us try to see or let us try to call the Intersect it.
Mapping one.
So once we have done this, but when you remove these sort of letters from intercepted mapping, will
this start now over here on?
Initially we had an M and B, but now here we just have been this, which is what we predicted from
the case.
It would be.
So now each side has just one potential decryption letter so we can use this at the mappings to start
decrypting.
Now, again, we will return to the interactive shell example one more time so we will not lose this.
We will keep this open now coming to a more simple sub function.
So if we go back to our interactive shell and let us open our file again.
So let's go back to you.
Drive your simple substitution.
Now, if we go back to over hack simple sub one function.
So now that you have seen how the function that is inside letter mapping one, your add letters to mapping
one, your intersected mappings one and remove some of letters from mapping one have manipulated the
cipher letter mapping that you have passed them.
So now let us use them in our particular program to decrypt the function.
OK, so now here we are going to define the victory or symbols of one function, which will take a parameter
of message start in that we will see intercepted maps.
One is equal to calling the blank Saifullah mappings cipher wordlist Asgeir in which we are stored in
the known Letrozole space.
But now here we are creating a new cipher letter mapping that, restoring the intersected map.
One variable and this variable will eventually hold intersected mappings for each of the cipher words.
Now after this, we basically remove any known little characters from the messages and reuse the objects.
Object in the known Letrozole space pattern matches in a string that is in the letter or provide space
character.
Then we have this sub function you can see over here if you just move a bit now in this sub matter,
on this sub function.
Now this is basically called on a regular expression and it has taken two arguments.
The function as the string in the second argument for matches, and it replaces those matches with the
string and the astonishment.
Then it returns a string with all these replacements.
And in the example, this method tells the program to go through the uppercase string and replace all
the known little characters with the blank string.
Now, this makes this subroutines a string with all punctuation numbered characters removed.
And this string is story for word, list of variable of which we have created.
Then we execute this forward list.
Variable should contain a list of uppercase letters and the for loop assigns each letter in the message
loosely cipher word variable.
And inside this little code creates a blank map gets deciphered.
All candidates are the candidate letters to decipher letter mappings and then intersects this mapping
with the intersected map.
Now we will see more in detail about this in the next session.
That's it from this session.
Thank you very much.