Check if 2 strings are anagrams of each other. Case-sensitive.
Time complexity: O(n)
Space complexity: O(n)
First string to compare
Second string to compare
Whether the strings are anagrams of each other
String
isAnagram('abc', 'cba'); // true Copy
isAnagram('abc', 'cba'); // true
isAnagram('abc', 'Cba'); // false Copy
isAnagram('abc', 'Cba'); // false
Check if 2 strings are anagrams of each other. Case-sensitive.
Time complexity: O(n)
Space complexity: O(n)