Question DSA-STR-0033
EasyHow can you check in O(n) time whether two strings are anagrams?
- A.
Check whether they have the same first letter
- B.
Compare every pair of characters
- C.
Count how often each character appears in both and compare the counts
- D.
Reverse one string and compare
Sign up free to see the answer and a step-by-step explanation.