A PC researcher has built up an encryption calculation. This calculation takes two sources of info – one plain word and another, a key. Qualities of data sources are as beneath.
Plain word: It is a string comprising of lowercase letters in order as it were.
Key: It is a lot of sets of strings comprising of lowercase letter sets as it were. For each pair, first string is the plain word and second string is its mystery word. The characters of these mystery words are confused yet lengths of Plain Word and Secret Word are equivalent.
This calculation finds the mystery characters for each character in the inputted plain word by utilizing the key. At that point it consolidates all the mystery characters in a similar request to shape a string called the mystery word. At long last yield this mystery word. Beneath table shows how mystery characters can be acquired from the key.
Your errand is to help him in actualizing the calculation as a PC program.
Note: It is ensured that all characters in the given plain word can be changed over to mystery characters by utilizing the given key.
Note: It is ensured that one plain content can be changed over to just one encoded text.
1 <= P <= 52000
1 <= N <= 26
1 <= Length of a plain word in pair <= 50000
1 <= Length of a mystery word in pair <= 50000
Length (plain word) == Length (mystery word)
First line contains string P meaning the plain content.
Second line contains a number N signifying number of key sets.
Next N lines, each contain two space isolated strings meaning plain content and key.
Print the encoded word.
“load” is the plain word to be encoded. Given Key contains 3 sets of Plain word and Secret word mix. They are <“app”, “lol”>, <“old”, “tip”> and <“odd”, “itt”>. From first pair, plainly the mystery character of ‘p’ is ‘l’ and that of ‘an’ is ‘o’. From third pair, unmistakably the mystery character of ‘d’ is ‘t’ and that of ‘o’ is ‘I’. By utilizing above discoveries, from second pair, unmistakably the mystery character of ‘l’ is ‘p’. Presently we can construct the mystery word by supplanting the characters of plain word by its comparing mystery characters as “piot”.
“An” is the plain word to be changed over to mystery word. The given key comprises of just one plain word – mystery word pair. i.e., <“a”, “b”>. From this, unmistakably the mystery character of ‘an’ is ‘b’, since there is just one character in both mystery and plain words. Along these lines, the last yield is “b”.
Codevita Season 9 All Questions Solutions
Listed Here :
- Single Lane Highway | Codevita 9 SOLUTIONS
- Factor of 3 Codevita 9 Solutions
- Corona Virus Codevita 9 Solutions
- String Pair Codevita 9 Solution
- 4 Particles Codevita 9 Solution
- String Word Codevita 9 Solution
- Binary Equivalent Codevita 9 Solution
- Equalize Weights Codevita 9 Solution
- Max Sum Codevita 9 Solution
- 3 Palindrome Codevita 9 Solution
- Secret Word Codevita 9 Solution
- Path through graph Codevita 9 Solution
- Unlocker codevita 9 Solution
- Tennis Score codevita 9 Solution
- 7 X 7 Codevita 9 Solution
- Railway Station Codevita 9 Solution
- Count Pairs Codevita 9 Solution