The problem description seems to be ambiguous for the get() function.


  • 6

    The problem states that get() provides a number which is not assigned to anyone. It does not state the order of the number can be given.
    However, the test cases are expecting a certain order from get() function's returns.
    If this specific order is expected, it should be stated in the problem statement.


  • 1

    It appears to not really be expected. I wrote solutions that provide other orders and got them accepted. For such problems, I think of "Expected:" as "Example:"


  • -1
    T

    Thats true.
    My code failed for this input

    Input:
    ["PhoneDirectory","release","get","release","release","get","get","check","get","release","get","release","release","get","check","release"]
    [[3],[2],[],[2],[0],[],[],[1],[],[0],[],[0],[0],[],[1],[1]]

    expected output
    Expected:
    [null,null,0,null,null,1,0,false,2,null,0,null,null,0,false,null]


Log in to reply
 

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