We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Solution--->(please upvote)
(1)Read the dictionary using files.You should store all words from "dictionary.lst" in a string variable.There is only one dictionary for all the test cases.All the necessary words are provided in the dictionary to get full score 50.
(2)So next thing to do is that input the string .
(3)then iterate through the string using loops
suppose
string is
"hdsssb jidcijsd isjs sc"
so when we iterate through it ..we get our first word as "hdsssb"
now you have to find an isomorphic word to "hdsssb" from the given dictionary
{so the question is what are isomorphic words?
ANS---> Two strings are said to be isomorphic if there is a one to one mapping possible for every character of str1 to every character of str2 and all occurrences of every character in str1 map to same character in str2.
Two strings are called isomorphic if the letters in one string can be remapped to get the second string. Remapping a letter means replacing all occurrences of it with another letter but the ordering of the letters remains unchanged. No two letters may map to the same letter, but a letter may map to itself.
Example-1: The words "abca" and "zbxz" are isomorphic because we can map 'a' to 'z', 'b' to 'b' and 'c' to 'x'.
Example-1: The words "bar" and "foo" are not isomorphic because we can map 'f' to 'b', 'o' to 'a' and 'o' to 'r'.
for a more better answer look the defination on internet.}
so when you know what are isomorphic words,you have to find an isomorph of the words given in input(i.e."hdsssb")
supppose
dictionary is
"hello not jargon mdaaan"
as "hdsssb" are isomorphic words so print "mdaan"
you have follow all these steps for all the words provided in the input
(4) The fourth point is that avoid my gramatical errors and think over the solution.Thanks for reading and please upvote.
(5)and it is not sure that you may get full 50 points after passing all the test cases.your score may become 49.8 or 49.7..its upto you.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Basic Cryptanalysis
You are viewing a single comment's thread. Return to all comments →