You are viewing a single comment's thread. Return to all comments →
Just a quick comment, in
elif command == 2: f[d[key]] = max(0, f[d[key]] - 1) d[key]= max(0, d[key] - 1) if d[key] > 0: f[d[key]] += 1
You don't need to check for if d[key] > 0 , as it's already taken care of in the max(0, d[key] - 1) part
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 →
Just a quick comment, in
You don't need to check for if d[key] > 0 , as it's already taken care of in the max(0, d[key] - 1) part