Articles in this series

You are given an integer array nums. In one move, you can pick an index i where 0 <= i < nums.length and increment nums[i] by 1. Return the minimum...

There are n seats and n students in a room. You are given an array seats of length n, where seats[i] is the position of the i<sup>th</sup> seat. You...

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...

Given two arrays arr1 and arr2, the elements of arr2 are distinct, and all elements in arr2 are also in arr1. Sort the elements of arr1 such that the...

A school is trying to take an annual photo of all the students. The students are asked to stand in a single file line in non-decreasing order by...

You are given an integer array nums and an integer k. In one operation, you can choose any index i where 0 <= i < nums.length and change nums[i] to...