Checking Anagrams (check whether two string is anagrams or not)
Given two strings, check whether two given strings are anagram of each other or not. An anagram of a string is another string that contains same characters, only the order of characters can be different
For example, "act" and "cat" are anagram of each other
Anagram means both the string contains the same set of character, only their orders are different. Thus, in both the string the frequency of each letter must be the same if they are an anagram of each other. Thus our algorithm checks and compare frequency of each letter in both the strings.
C++ program to check whether two string is anagrams or not
Outputneed an explanation for this answer? contact us directly to get an explanation for this answer