Frequency Queries

  • + 0 comments

    Great solution , I thought of the same idea , but I think in the second dictionary you don't need to keep track of the exact numbers for each frequency key since the question only asks about whether there is a number of a certain frequency or not so you can only keep the count of the numbers having a certain frequency key as the value for the second dictionary and update that count while inserting and deleting elements