• Courses
  • Tutorials
  • DSA
  • Data Science
  • Web Tech
July 18, 2024 |6.3K Views

Remove minimum number of characters so that two strings become anagram

  Share   Like
Description
Discussion

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.

Examples :  

Input : str1 = "bcadeh" str2 = "hea"
Output: 3
We need to remove b, c and d from str1.

Remove minimum number of characters so that two strings become anagram: https://www.geeksforgeeks.org/remove-minimum-number-characters-two-strings-become-anagram/