प्रश्न
00:00

13. Remove Duplicates from Sorted Array

आसानदो पॉइंटरMicrosoftGoogle

Given an array nums sorted in non-decreasing order, remove duplicates in place so each element appears once, and return the new length.

उदाहरण 1:

इनपुट: nums = [1,1,2]
आउटपुट: 2

उदाहरण 2:

इनपुट: nums = [0,0,1,1,1,2,2,3,3,4]
आउटपुट: 5

सीमाएँ:

  • 1 <= nums.length <= 3 * 10^4
  • nums is sorted in non-decreasing order.
मुख्य कोड मोड
● अपने आप सहेजा गयापंक्ति 1, कॉलम 1