What does the optimized frequency map track?
Practice this question from Valid Anagram - Frequency map Pattern Practice Quiz, with options and an explanation.
Question
What does the optimized frequency map track?
Option A
Only the first character
Option B — Correct answer
Character frequencies
Option C
Character positions after sorting
Option D
The longest prefix
Explanation
It tracks how many times each character appears and subtracts counts for the second string.