Problem solving with programming: Number of deletions needed to make anagrams
Given two strings, how do we find the number of characters to be deleted from both the strings in order to make them anagrams.Two words are said to be anagrams if one word can be formed by re-arranging the letters of another word. For example the words "TAN" and "ANT" are anagrams.
Given two words "clean" and "lion", we need to delete 5 characters from both the strings, {c,e,a} from the first and {i,o} from the second.
Read full article from Problem solving with programming: Number of deletions needed to make anagrams
No comments:
Post a Comment