What this problem means: It doesn't matter what you leave beyond the new length?


  • 0
    S

    But I still can't understand it totally. Could you help me?

    1. remove all instances of that value in place: remove all items equal to 'val' in place?
    2. It doesn't matter what you leave beyond the new length: what that means? input: [4, 5, 4] output: [5, 4, 4]. Those items equal to 'val' still stay at the same array but behind others?

  • 0
    D

    for example,input[4,5,4,3,2,1], and remove 4,the output may be[5,3,2,1,x,x], it doesn't care what x is.
    and the length is 4. it doestn't care what the element is if the array length beyond 4.


Log in to reply
 

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