Find All Duplicates in an Array

Given an array nums of n integers where each integer is in the range , return an array of all the integers that appear more than once in the array,…

Kth Missing Positive Number

Given an array arr of positive integers sorted in ascending order, and an integer k, find the kth positive integer that is missing from the array.

Squares of a Sorted Array

Given an array of integers nums sorted in non-decreasing order, return an array of the squares of each number sorted in non-decreasing order.

Sort Colors

Given an array nums with n objects colored red, white, or blue, sort them in-place so that objects of the same color are adjacent, with the colors in the order…

Reverse String

Given a character array s, reverse the order of its elements in-place.

Move Zeroes

Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero elements. Modify the array in-place with…

Remove Element

Given an array nums and a value val, remove all instances of that value in-place and return the new length of the array. Do not allocate extra space for another…

Remove Duplicates from Sorted Array

Given a sorted array nums, remove the duplicates in-place such that each element appears only once and returns the new length. Do not allocate extra space for another array. Modify…