Two Sum (LeetCode 1)
The problem You get an array of integers and an integer . Return the indices of…
Tag
54 posts
The problem You get an array of integers and an integer . Return the indices of…
The problem You get an array of non-negative integers; each is the height of a…
The problem You get an array sorted in non-decreasing order and a . Exactly one…
The problem You get an integer array (values may be negative) and an integer…
The problem You get an integer array sorted in non-decreasing order. It may…
The problem You get a sorted array of distinct integers and a . If is in the…
The problem An array of distinct integers was sorted in ascending order and then…
The problem You get an integer array sorted in non-decreasing order. Rearrange…
The problem You are given an integer array that never changes. Build a class…
The problem Given an integer array , return an array where is the product of…
The problem A non-negative integer is stored as a list of its digits, most…
The problem You get an integer array and an integer . Cut the array into…
The problem You get an integer array that is circular: after the last element…
The problem You get an integer array . Move all the s to the end in place, while…
The problem You get an array of positive integers and a positive integer…
The problem You pick a positive integer , then add the numbers of to it one at…
The problem You get an array , where is the price of stepping off step . You…
The problem You get a list of triplets and a triplet. One operation picks two…
The problem You get two sorted arrays (length ) and (length ). Return the…
The problem Given an integer array (values can be negative) and an integer…
The problem Given an integer array (at least one element, values can be…
The problem Given an integer array (at least one element; values may be…
The problem You get an integer array and an integer . Among all contiguous…
The problem You get a binary array (only 0s and 1s) and an integer . You may…
The problem You get a binary array . You must delete exactly one element. Return…
The problem You get an unsorted array of integers . Return the length of the…
The problem You get an array of non-negative integers, the heights of bars in a…
The problem You start at index 0 of an array of non-negative integers. is the…
The problem You stand at index 0 of an array . From index you may jump forward…
The problem You get a list of non-overlapping intervals sorted by start, and one…
The problem Houses stand in a row and is the money in house (all values non…
The problem Same rules as House Robber: is the money in house , and you cannot…
The problem There are stations on a circular road. Station gives you fuel…
The problem A row of trees is given as an array , where is the type of fruit on…
The problem You get an array of length . Every value is between and , and…
The problem You get an integer array where no two neighbours are equal. A peak…
The problem A sorted array of distinct integers has been rotated some number of…
The problem You get an array sorted in non-decreasing order (duplicates allowed…
The problem Given an integer array , find the pivot index: the leftmost index…
The problem You get an array of daily temperatures. For each day , return how…
The problem You get an array where is the height of a vertical wall at…
The problem Given a binary array (only 0s and 1s), return the length of the…
The problem You get an array of integers . Return if any value appears at least…
The problem You get a circular array of non-zero integers. Standing on index…
The problem Children stand in a line, each with a rating. Give out candies so…
The problem You get an array of distinct integers sorted in ascending order…
The problem You get an array where is a stock’s price on day . You may buy…
The problem You get an array of non-zero integers, each an asteroid in a row…
The problem You get an integer array . Return every unique triplet of values…
The problem You get an integer array and a . Return every unique quadruplet…
The problem You get an integer array (at least three numbers) and a . Choose…
Prefix sums are a quiet superpower: a tiny O(n) precomputation that makes every…
Sliding window is two pointers’ close cousin, specialised for contiguous sub…
Two pointers is the first pattern to master — it is simple, it appears…