All problems
Arrays problems
54 problems: 15 easy, 34 medium and 5 hard. Start at the top; each one assumes the ones above it.
- Not startedEasyBest day to buy and sellDynamic programming, Arrays
- Not startedEasyBuilding Pascal's triangle row by rowDynamic programming, Basics, Arrays
- Not startedEasyContains duplicateArrays, Hash sets
- Not startedEasyFind it by halvingArrays, Binary search
- Not startedEasyMove the zeroes to the endArrays, Two pointers
- Not startedEasyRunning sumArrays, Prefix sums
- Not startedEasySearch insert positionArrays, Binary search
- Not startedEasySqueeze out the duplicatesArrays, Two pointers
- Not startedEasyThe best k days in a rowArrays, Sliding window
- Not startedEasyThe next bigger number to the rightArrays, Stacks and queues
- Not startedEasyThe number more than halfArrays, Hash maps
- Not startedEasyThe number that appears onceBit manipulation, Arrays, Hash maps
- Not startedEasyTwo sumArrays, Hash maps
- Not startedEasyTwo sum in a sorted listTwo pointers, Binary search, Arrays
- Not startedEasyWhat two lists have in commonArrays, Hash sets
- Not startedMediumBinary search on a sorted list someone rotatedArrays, Binary search
- Not startedMediumBlank out every row and column holding a zeroMatrices, Arrays
- Not startedMediumCan it be split into two equal halvesDynamic programming, Arrays
- Not startedMediumCan you get to the endArrays, Greedy
- Not startedMediumCombine the ranges that overlapSorting, Arrays, Greedy
- Not startedMediumEvery subset, in orderArrays, Backtracking
- Not startedMediumEvery way to make the targetArrays, Backtracking
- Not startedMediumFitting the most value into the bagDynamic programming, Arrays
- Not startedMediumHow long this price has been the bestArrays, Stacks and queues
- Not startedMediumHow long until it gets warmerArrays, Stacks and queues
- Not startedMediumHow many must you dropSorting, Arrays, Greedy
- Not startedMediumHow many triples add to zeroSorting, Arrays, Two pointers
- Not startedMediumHow many ways down through the gridDynamic programming, Matrices, Arrays
- Not startedMediumLongest run of consecutive numbersArrays, Hash sets
- Not startedMediumMaximum subarray sumDynamic programming, Arrays
- Not startedMediumMost frequent numbersSorting, Arrays, Heaps, Hash maps
- Not startedMediumProduct of everything elseArrays, Prefix sums
- Not startedMediumRead the grid in a spiralMatrices, Arrays
- Not startedMediumSharing the books so nobody reads too muchArrays, Binary search
- Not startedMediumShortest stretch that reaches the targetArrays, Sliding window
- Not startedMediumSorting 0s, 1s and 2s in one passSorting, Arrays, Two pointers
- Not startedMediumThe best you can take without touching neighboursDynamic programming, Arrays
- Not startedMediumThe cheapest way down through the gridDynamic programming, Matrices, Arrays
- Not startedMediumThe first negative number in every windowArrays, Sliding window, Stacks and queues
- Not startedMediumThe kth largest, without sorting everythingArrays, Heaps
- Not startedMediumThe longest run of ones, with k flipsArrays, Sliding window
- Not startedMediumThe one number that is not repeated three timesBit manipulation, Arrays
- Not startedMediumThe slowest speed that still finishes in timeArrays, Binary search
- Not startedMediumThe smallest ship that still finishes in timeArrays, Binary search
- Not startedMediumThe smallest value after a rotationArrays, Binary search
- Not startedMediumThe widest, deepest containerArrays, Two pointers, Greedy
- Not startedMediumTurn the square a quarter turnMatrices, Arrays
- Not startedMediumTwo baskets, one row of treesArrays, Sliding window, Hash maps
- Not startedMediumWhere a repeated value starts and endsBinary search, Arrays
- Not startedHardHow far the list is from sortedSorting, Arrays
- Not startedHardMerging many sorted lists at onceSorting, Arrays, Heaps
- Not startedHardThe biggest rectangle inside a histogramArrays, Stacks and queues
- Not startedHardThe largest number in every windowArrays, Sliding window, Stacks and queues
- Not startedHardWater held between the barsTwo pointers, Stacks and queues, Arrays