Strings Making Anagrams

Coding Challenge Coding Live

We must deletecharacters to make both strings anagrams, so we printon a new line.

Complete themakeAnagramfunction in the editor below. It must return an integer representing the minimum total characters that must be deleted to make the strings anagrams.

Print a single integer denoting the number of characters you must delete to make the two strings anagrams of each other.

The second line contains a single string,.

We use cookies to ensure you have the best browsing experience on our website. Please read ourcookie policyfor more information about how we use cookies.

makeAnagram has the following parameter(s):

Some error occured while loading page for you. Please try again.

We delete the following characters from our two strings to turn them into anagrams of each other:

Alice 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 find this number?

Alice is taking a cryptography class and findinganagramsto be very useful. We consider two strings to be anagrams of each other if the first strings 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,bacdcanddcbacare anagrams, butbacdcanddcbadare not.

Check out the resources on the pages right side to learn more aboutstrings. The video tutorial is by Gayle Laakmann McDowell, author of the best-selling interview bookCracking the Coding Interview.

Given two strings,and, that may or may not be of the same length, determine the minimum number of character deletions required to makeandanagrams. Any characters can be deleted from either of the strings.

The first line contains a single string,.

Leave a Reply