Remove Duplicates from Sorted Array with At Most K Occurrences

Given a non-decreasing sorted integer array nums and an integer k, remove duplicates in place so that every distinct value appears at most k times.

Return the resulting length m. The first `m...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: