All challenges

Arrays

Lists of values: scanning, summing, shifting and building new lists.

StatusChallengeLevelSave
1.Sum of a listRead a list of numbers and print their total.Easy
2.Two SumFind the two positions whose numbers add up to a target.Easy
3.Merge Sorted ArraysMerge two sorted arrays into one sorted array.Easy
4.Best Time to TradePick one day to buy and a later day to sell for the biggest profit.Easy
5.Contains DuplicateCheck whether any number appears twice.Easy
6.Missing NumberFind the one number missing from 0 to n.Easy
7.Single NumberEvery number appears twice except one; find it.Easy
8.Move ZerosMove every zero to the end, keeping the other numbers in order.Easy
9.Binary SearchFind a number's position in a sorted array in log time.Easy
10.Majority ElementFind the value that fills more than half of the array.Easy
11.Plus OneAdd one to a number stored as an array of digits.Easy
12.Squares of a Sorted ArraySquare every number of a sorted array and keep it sorted.Easy
13.Product Except SelfFor each position, multiply every other number, without dividing.Medium
14.Maximum SubarrayFind the largest sum of a run of consecutive numbers.Medium
15.Top K FrequentReturn the k values that appear most often.Medium
16.Three SumFind every distinct triple of numbers that adds up to zero.Medium
17.Container With Most WaterPick two walls that hold the most water between them.Medium
18.Rotate MatrixTurn a square grid of numbers 90 degrees clockwise.Medium
19.Spiral MatrixRead a grid in a clockwise spiral from the outside in.Medium
20.Search in a Rotated ArrayBinary-search a sorted array that has been rotated.Medium
21.Merge IntervalsMerge every pair of overlapping intervals.Medium
22.Days Until WarmerFor each day, count the days until a warmer one.Medium
23.Jump GameDecide whether you can jump from the first square to the last.Medium
24.Subarray Sum Equals KCount the runs of consecutive numbers that add up to k.Medium
25.Trapping Rain WaterWork out how much rain water a skyline of bars holds.Hard
26.Median of Two Sorted ArraysFind the median of two sorted arrays taken together.Hard
27.Largest Rectangle in a HistogramFind the biggest rectangle that fits under a bar chart.Hard
28.Sliding Window MaximumReport the largest number in every window of k as it slides along.Hard