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 areanagram 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
- Check whether two strings are anagram of each other
- Python sorted() to check if two strings are anagram or not
- How to check if a key exists in a HashMap in Java
- Longest common anagram subsequence from N strings
- Remove minimum number of characters so that two strings become anagram
- Using Counter() in Python to find minimum character removal to make two strings anagram
- Minimum Number of Manipulations required to make two Strings Anagram Without Deletion of Character
- Check if any anagram of a string is palindrome or not
- Check if binary representations of two numbers are anagram
- Check if binary representation of a given number and its complement are anagram
- Number of sub-strings which are anagram of any sub-string of another string
- HashMap in Java
- HashMap get() Method in Java
- Hashmap vs WeakHashMap in Java
- HashMap put() Method 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 email@example.com. 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.