OJ doesn't cover one corner case


  • 0
    G

    store a timestamp-->id mapping is not a good idea. The description doesn't say that two logs must have different timestamp, so they may be the same. For the following test cases:

    ["LogSystem","put","put","put","put","retrieve","retrieve"]
    [[],[1,"2017:01:01:23:59:59"],[2,"2017:01:01:23:59:59"],[3,"2017:01:01:22:59:59"],[4,"2016:01:01:00:00:00"],["2016:01:01:01:01:01","2017:01:01:23:00:00","Year"],["2016:01:01:01:01:01","2017:01:01:23:00:00","Hour"]]

    This particular solution may return [null,null,null,null,null,[4,3,2],[3,2]], and expected answer is [null,null,null,null,null,[4,3,1,2],[3,1,2]], obviously OJ doesn't catch this.


Log in to reply
 

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