Skip to content

Commit b8eebcd

Browse files
committed
Update remove-duplicates-from-sorted-array.js
1 parent 0034b4e commit b8eebcd

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,12 @@
1+
/**
2+
* Question:
3+
* Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.
4+
* Do not allocate extra space for another array, you must do this in place with constant memory.
15
6+
* For example,
7+
* Given input array nums = [1,1,2],
8+
9+
* Your function should return length = 2, with the first two elements of nums being 1 and 2 respectively.
10+
* It doesn't matter what you leave beyond the new length.
11+
*
12+
*/

0 commit comments

Comments
 (0)