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
All Answers
total answers (1)
total answers (1)
Algorithm:
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
Output
need an explanation for this answer? contact us directly to get an explanation for this answer