Making An Anagram in Frequency Based Approach
Out of Free Stories? Here is my Friend Link.
I have published an ebook. A compilation of 100 Java(Interview) Programming problems which have been solved . I have given clear explanation and the code in the book. Believe me when I say, this will kick start you to achieve the job at your dream company.
Click on this link to get you to the landing page. It is completely free when you use kindle amazon. Take a look at it.
Making Anagrams
We consider two strings to be anagrams of each other if the first string’s letters can be rearranged to form the second string. In other words, both strings must contain the same exact letters in the same exact frequency. For example, bacdc
and dcbac
are anagrams, but bacdc
and dcbad
are not.
Alice is taking a cryptography class and finding anagrams to be very useful. She decides on an encryption scheme involving two large strings where encryption is dependent on the minimum number of character deletions required to make the two strings anagrams. Can you help her…