Dev
Mentor
Coach Interview AI
Mock Interview AI
Coding Problems
Blog
Pricing
Toggle theme
Sign In
Get Started
Toggle theme
Loading...
For the best coding experience, use a desktop browser.
Easy
Two Pointers
Remove Duplicates from Sorted Array
Remove duplicates in-place from sorted
nums
and return the new length.
Examples
Input:
nums = [1,1,2]
Output:
2
Sample Test Cases
Case 1 Input:
[1,1,2]
Expected:
2
Case 2 Input:
[0,0,1,1,1,2,2,3,3,4]
Expected:
5
Reset
Run
Submit
Loading editor...
Test Case
Output
Submission
Case 1 Input:
[1,1,2]
Expected:
2
Case 2 Input:
[0,0,1,1,1,2,2,3,3,4]
Expected:
5