Write a function to check whether two given strings are an Anagram of each other or not.
An anagram of a string is another string that contains the same characters, only the order of characters can be different.
For example, “abcd” and “dabc” are an Anagram of each other.
Approach: Hashmaps can also be used to find if any two given strings are anagrams or not, by mapping the characters of each string to individual hashmaps and comparing them together.
Strings to be checked are: geeksforgeeks forgeeksgeeks The two strings are anagrams of each other Strings to be checked are: geeksforgeeks geeks The two strings are not anagram of each other
Related Article: Check whether two strings are anagram of each other
Attention reader! Don’t stop learning now. Get hold of all the important Java and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready.
- Check whether two strings are anagram of each other
- Check whether two strings are anagrams of each other using unordered_map in C++
- Python sorted() to check if two strings are anagram or not
- Check if two strings are permutation of each other
- Using Counter() in Python to find minimum character removal to make two strings anagram
- Java program to count the occurrence of each character in a string using Hashmap
- Minimum Number of Manipulations required to make two Strings Anagram Without Deletion of Character
- Remove minimum number of characters so that two strings become anagram
- Check if binary representations of two numbers are anagram
- Longest common anagram subsequence from N strings
- Number of sub-strings which are anagram of any sub-string of another string
- Check if two arrays are permutations of each other
- How to check if a key exists in a HashMap in Java
- Convert a Roman Number to Decimal using Hashmap in Java
- Check if binary representation of a given number and its complement are anagram
- Check if any anagram of a string is palindrome or not
- Anagram checking in Python using collections.Counter()
- Remove an Entry using key from HashMap while Iterating over it
- Remove an Entry using value from HashMap while Iterating over it
- HashMap and TreeMap in Java
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.