Three lessons:
Frequency counting reveals which elements appear too many or too few times.
Compare the expected set with the actual array to find discrepancies.
Use arrays instead of maps when the key range is small and bounded.
When constraints give you a small range like $1$ to $n$, arrays are simpler than sets.