[11 Feb 2020] Remove minimum number of characters so that two strings become anagram
Remove minimum number of characters so that two strings become anagram
Given two strings in lowercase, the task is to make them anagram. The only allowed operation is to remove a character from any string. Find minimum number of characters to be deleted to make both the strings anagram?
If two strings contains same data set in any order then strings are called Anagrams.
If two strings contains same data set in any order then strings are called Anagrams.
Examples :
Input : str1 = "bcadeh" str2 = "hea" Output: 3 We need to remove b, c and d from str1. Input : str1 = "cddgk" str2 = "gcd" Output: 2 Input : str1 = "bca" str2 = "acb" Output: 0
Output :
3
Output :
3
Output :
3
Comments
Post a Comment