Frequency Comparator
MultisetsMediumVerify bag/multiset equalities by comparing frequency distributions of integers, strings, or characters.
Alt+Shift+4
Configuration Panel
1
2
3
4
5
6
7
8
1
2
3
4
5
6
7
8
Example Test Cases
Permutation frequency match
Input 1:int;1 2 2 3 3 3;3 2 3 1 2 3
Output:Frequencies match completely (1:1, 2:2, 3:3)
Load Case
Character distribution comparison
Input 1:char;hello;world
Output:Mismatch on frequency of 'l', 'o', 'h', 'e', 'w', 'r', 'd'
Load Case
Complexity Specs
Time ComplexityO(N log N)
Space ComplexityO(N)
Notes & Tips
- Supports tokenizing integers (numeric lists), raw characters, or words.
- Particularly helpful for checking if permutation answers contain valid counts.
- Highlighted red rows show count discrepancies between inputs.