There is a wrong in the example


  • -5
    G

    In the question
    Given 1->4->3->2->5->2 and x = 3,
    return 1->2->2->4->3->5.

    the return shoule be "1->2->2->3->4->5"


  • 1
    B

    Actually I just finished the exercise and find the example is correct.
    Please read carefully the requirement and I think you can find why.

    Good Luck bro!


  • 0
    N

    The sample is correct. But it could give a better example, for showing that the original order should be kept:

     x = 3
     given 
         2->5->4->1->3->2->7->5
     returns 
         2->1->2->5->4->3->7->5

Log in to reply
 

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