Skip to content
Algorithms for Beginners

Problems

Every problem here is original, with an editor to try it, hints when you are stuck, and a full walkthrough. More arrive with each pattern.

SolvedProblemPatternDifficulty
Pair to targetHashing and countingeasy
Spot a repeatHashing and countingeasy
Letter twinsHashing and countingeasy
First lonely letterHashing and countingeasy
Group the twinsHashing and countingmedium
Longest runHashing and countingmedium
Mirror phraseTwo pointerseasy
Flip in placeTwo pointerseasy
Pair in a sorted listTwo pointerseasy
Squash repeatsTwo pointerseasy
Biggest tankTwo pointersmedium
Three to zeroTwo pointersmedium
Best streakSliding windoweasy
Longest unique stretchSliding windowmedium
Shortest to targetSliding windowmedium
Repaint the fenceSliding windowmedium
Hidden shuffleSliding windowmedium
Two kindsSliding windowmedium
Find the numberBinary searcheasy
Where it would goBinary searcheasy
Whole square rootBinary searcheasy
First and lastBinary searchmedium
Search a rotated listBinary searchmedium
Slowest speed that finishesBinary searchmedium
Balanced bracketsStackeasy
Typing with backspaceStackeasy
Stack with minimumStackmedium
Postfix calculatorStackmedium
Tidy a file pathStackmedium
Days until warmerStackmedium