Search
⌘K

Leetcode 80. Remove Duplicates from Sorted Array II

Given a sorted array, remove duplicates in-place so that each distinct value appears at most twice and return the new length k, preserving relative order and using O(1) extra space.

Asked at:

Amazon

Amazon


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Late November, 2024

Amazon

Amazon

Junior

Remove Duplicates from Sorted Array II (with some Object-Oriented Design variation)

Comments

Your account is free and you can post anonymously if you choose.