Leetcode 0026. Remove Duplicates from Sorted Array

Posted on Fri 01 November 2024 in Leetcode • Tagged with array-shift, two-pointers

Question Link : https://leetcode.com/problems/remove-duplicates-from-sorted-array/

Difficulty: Easy

Premium: False

Question

Given an integer array nums sorted in non-decreasing order, remove the duplicates in-place such that each unique element appears only once. The relative order of the elements should be kept the same. Then return the number of unique …


Continue reading

Leetcode 0283. Move Zeroes

Posted on Thu 03 November 2022 in Leetcode • Tagged with array-shift, two-pointers

Question Link : https://leetcode.com/problems/move-zeroes/

Difficulty: Easy

Question

Given an integer array nums, move all 0's to the end of it while maintaining the relative order of the non-zero elements. Note that you must do this in-place without making a copy of the array.   Example 1: Input: nums …


Continue reading