NeetCode #197LC-80MediumTwo Pointers
← Back to All Problems#197 · #80 · Remove Duplicates from Sorted Array II(删除有序数组中的重复项 II)
📌 Problem Statement & Constraints
Given an integer array
nums sorted in non-decreasing order, remove duplicates in place so that each unique element appears at most twice. Return the new length k; the first k slots must hold the result. Constraints: 1 <= nums.length <= 3 * 10^4, -10^4 <= nums[i] <= 10^4.🔒
Sign In to Unlock Full Solutions for All 973 Problems
Sign in to access step-by-step logic, benchmark Python3 code, complexity breakdown, and offline export!