You are viewing a single comment's thread. Return to all comments →
your solution is 98% correct, but when frequency reaches 0 then that element should be removed from the map.
so in
elif(queries[i][0] == 2): if queries[i][1] in num: num[queries[i][1]] = num[queries[i][1]] - 1 if num[queries[i][1]] == 0: del num[queries[i][1]]
Seems like cookies are disabled on this browser, please enable them to open this website
Frequency Queries
You are viewing a single comment's thread. Return to all comments →
your solution is 98% correct, but when frequency reaches 0 then that element should be removed from the map.
so in