dsa2 min read
Valid Anagram — Frequency Array vs HashMap [Amazon, Google Easy]
Check if two strings are anagrams — same characters with same frequencies. Two O(n) approaches: 26-int array for lowercase, HashMap for Unicode.
Read →
webcoderspeed.com
2 articles
Check if two strings are anagrams — same characters with same frequencies. Two O(n) approaches: 26-int array for lowercase, HashMap for Unicode.
Find the index of the first non-repeating character in a string. Two-pass O(n) solution with a 26-array or HashMap.