param { number [ ] } nums return { number } var removeDuplicates = function ( nums ) { let p1 = 0 ; let p2 = 0 ; let len = nums . length ; while ( p2 < len ) { while ( nums [ p2 ] === nums [ p1 ] ) { p2 ++ ; } p1 ++ ; nums [ p1 ] = nums [ p2 ] ; } return p1 ; } ; export { removeDuplicates } ;