Anagrams

2

2 votes
Easy
Problem

In network security,anagrams are found to be useful for cryptography. 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,SILENT and LISTEN are anagrams but bacdc and dcbad are not.

A team of network security specialists decides on an encryption scheme called anagramming which involves two large strings where encryption technique is dependent on the minimum number of character deletions required to make the two strings anagrams.

You are given two strings that may or may not be of the equal length, determine the minimum number of character deletions required to make given two strings anagrams. Any number of characters can be deleted from either of the string.Can you help that team to find this number?

INPUT FORMAT

The first line contains the first input string.
The second line contains the second input string.

CONSTRAINTS

1≤length(a)≤10000.
1≤length(b)≤10000.
The inputs are Case insensitive

OUTPUT FORMAT

If the two strings are already anagrams print TWO STRINGS ARE ALREADY ANAGRAMS.
Else print the number of characters to be deleted.

Time Limit: 5
Memory Limit: 256
Source Limit:
Explanation

consider two strings abc and cde
abc and cde are not anagrams but by deleting ab from abc and de from cde we can make both the strings as anagrams as only c is left in both the strings.

Consider the strings ALGORITHM and thmalgori
As the inputs are case insensitive,ALGORITHM and thmalgori are already anagrams.
So there is no need for character deletions

Editor Image

?