Invalid input ?

  • 0

    All tests are passed for code using the priority queue method, but with the two stack method, my code can't pass the following test:

    [41,37,44,24,39,42,48,1,35,38,40,null,43,46,49,0,2,30,36,null,null,null,null,null,null,45,47,null,null,null,null,null,4,29,32,null,null,null,null,null,null,3,9,26,null,31,34,null,null,7,11,25,27,null,null,33,null,6,8,10,16,null,null,null,28,null,null,5,null,null,null,null,null,15,19,null,null,null,null,12,null,18,20,null,13,17,null,null,22,null,14,null,null,21,23], 5.142857, 45

    I found that the tree above is not actually a valid binary search tree.

    Please correct me if I am wrong.

  • 0

    I've just checked it and the input is indeed a valid binary search tree.

Log in to reply

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