What should be given if a different value is set for the same key.


  • 0
    M

    In the test case given in the website never changed value set for the same key. However, I want to know that if I change the value of the same key, whether the frequency should be reset to 1 or it will keep its origin frequency value and add by 1. Thanks.


  • 0
    M

    @mayuanakira By running the test cases, I found that the "set" command will also increase the frequency for the key even give this key different value.


Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.