What does "next smallest number" mean? still can't understand

  • 1

    first i thought it's actually the smallest number, because when i input [5,0,10], the correct result is [0,5,10].
    but if i input [5,0,10,#,#,9,11], expected answer is [0,0,0,5,9,10,11].

  • 0

    You should input [5,0,10,null,null,9,11] instead of [5,0,10,#,#,9,11] . "null' is used to represent a NULL node and not "#". If you entered it right, the result will be correct as you predicted.

Log in to reply

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