You are viewing a single comment's thread. Return to all comments →
Why do you do
cnt[freq[value]] -= 1
before and after actions 1 and 2? Why do they not cancel out?
Because freq[value] changes between 1st and 2nd call. So it decreases and increases freq for different entries.