Loading
Learn each structure and pattern in order, with stepped visuals.
Every problem draws its data and replays your code on it, line by line.
Practise by pattern. Open any problem to see its input drawn, then watch your own code move through it.
Two indices moving under a rule that never lets them backtrack.
| Status | Problem | Difficulty | Visual | Saved |
|---|---|---|---|---|
| Compact the Queue#3 | Easy | array | ||
| Rotate the Roster |
| Medium |
| array |
| Normalise and Compare#9 | Easy | string |
| Longest Mirrored Core#10 | Medium | string |
| Compress Run Lengths#11 | Easy | string |
| Reverse Words in a Log Line#12 | Easy | string |
| Sorted Pair Target#22 | Easy | array |
| Dedupe a Sorted Log#23 | Easy | array |
| Widest Water Span#24 | Medium | array |
| Sorted Squares of a Signed Series#25 | Easy | array |
| Balanced Triples#26 | Hard | array |
| Reverse the Chain#37 | Easy | linked list |
| Merge Two Sorted Chains#39 | Easy | linked list |
| Shared Free Windows#80 | Medium | grid |
| Spiral Readout#92 | Easy | grid |
| Sorted Ledger Lookup#96 | Easy | grid |
A contiguous range that grows and shrinks instead of restarting.
| Status | Problem | Difficulty | Visual | Saved |
|---|---|---|---|---|
| Strongest Signal Window#8 | Easy | array | ||
| Longest Distinct Stretch#27 | Medium | string | ||
| Longest Uniform Run After Swaps#28 | Medium | string | ||
| Shortest Covering Run#29 | Hard | string | ||
| Count Low-Product Windows#30 | Medium | array | ||
| Densest Signal Window#31 | Easy | string | ||
| Recent Request Counter#47 | Easy | array |
Precompute cumulative totals so any range answers in constant time.
| Status | Problem | Difficulty | Visual | Saved |
|---|---|---|---|---|
| Running Altitude#1 | Easy | array | ||
| Shelf Rebalance#2 | Easy | array | ||
| Yield Without Self#5 | Medium | array | ||
| Budget Windows#19 | Medium | array | ||
| Reading Range Totals#148 | Easy | array | ||
| Divisible Stretches#149 | Medium | array | ||
| Plots With a Target Yield#150 | Hard | grid |
Halve the search space using a yes/no question that flips exactly once.
| Status | Problem | Difficulty | Visual | Saved |
|---|---|---|---|---|
| First Failing Build#32 | Easy | array | ||
| Insertion Slot#33 | Easy | array | ||
| Rotated Catalogue Search#34 | Medium | array | ||
| Minimum Throughput#35 | Medium | array | ||
| First and Last Occurrence#36 | Medium | array | ||
| Integer Floor Root#130 | Medium | number | ||
| Summit Marker#138 | Easy | array | ||
| Missing Heartbeat#139 | Easy | array | ||
| Sensor Spacing#140 | Medium | array | ||
| Fairest Shift Split#141 | Hard | array |
Two walkers at different speeds reveal cycles and midpoints.
| Status | Problem | Difficulty | Visual | Saved |
|---|---|---|---|---|
| Middle of the Chain#38 | Easy | linked list | ||
| Drop the Nth Stage from the End#40 | Medium | linked list | ||
| Does the Chain Loop?#41 | Medium | array | ||
| Does the Digit Chain Settle?#126 | Easy | number |
Trade memory for time by remembering what you have already seen.
| Status | Problem | Difficulty | Visual | Saved |
|---|---|---|---|---|
| First Unrepeated Symbol#13 | Easy | string | ||
| Rearrangement Check#14 | Easy | string | ||
| Matching Pair Sum#16 | Easy | array | ||
| Group by Signature#17 | Medium | words | ||
| Longest Consecutive Run#18 | Medium | array | ||
| Duplicate Within Distance#20 | Easy | array |
A stack kept in sorted order answers "next greater" in one pass.
| Status | Problem | Difficulty | Visual | Saved |
|---|---|---|---|---|
| Warmest Day Ahead#6 | Medium | array | ||
| Valid Nesting#15 | Easy | string | ||
| Evaluate a Postfix Formula#42 | Medium | words | ||
| Stack With Instant Minimum#43 | Medium | array | ||
| Queue From Two Stacks#44 | Medium | array | ||
| Collapse Adjacent Duplicates#45 | Easy | string | ||
| Rolling Peak#46 | Hard | array |
A heap of size k beats sorting everything you do not need.
| Status | Problem | Difficulty | Visual | Saved |
|---|---|---|---|---|
| Top Frequency Codes#21 | Medium | array | ||
| K-th Loudest Reading#111 | Easy | array | ||
| Nearest Charging Stations#113 | Medium | grid | ||
| Top Search Terms#115 | Medium | words |
Sort by start, then decide overlap against one running interval.
| Status | Problem | Difficulty | Visual | Saved |
|---|---|---|---|---|
| One Calendar, No Clashes#75 | Easy | grid | ||
| Consolidate Booked Slots#78 | Medium | grid | ||
| Slot In a New Booking#79 | Medium | grid | ||
| How Many Studios?#83 | Medium | grid |
When values are a permutation of indices, the array is its own map.
| Status | Problem | Difficulty | Visual | Saved |
|---|---|---|---|---|
| Reprinted Badge#145 | Easy | array | ||
| Unfilled Seats#146 | Easy | array | ||
| Smallest Unclaimed Ticket#147 | Hard | array |
Build a candidate incrementally, and undo the moment it cannot work.
| Status | Problem | Difficulty | Visual | Saved |
|---|---|---|---|---|
| Generate Balanced Groupings#49 | Medium | number | ||
| Count Subsets With a Target Sum#50 | Medium | array | ||
| Keypad Spellings#131 | Medium | string | ||
| Feature Bundles#132 | Medium | array | ||
| Seating Orders#133 | Medium | array | ||
| Voucher Bundles#134 | Medium | array | ||
| Rooftop Beacons#135 | Hard | number | ||
| Letter Grid Trail#136 | Medium | words | ||
| Mirror Cuts#137 | Medium | string |
Expand level by level, so the first time you arrive is the shortest way.
| Status | Problem | Difficulty | Visual | Saved |
|---|---|---|---|---|
| Paint Bucket Region#91 | Easy | grid | ||
| Mould Spread#98 | Medium | grid | ||
| Shortest Clear Corridor#99 | Medium | grid | ||
| Can the Curriculum Be Finished?#102 | Medium | number | ||
| Curriculum Order#103 | Medium | number | ||
| Two-Team Split#104 | Medium | grid | ||
| Knight Hops#106 | Medium | number | ||
| Draining to Both Coasts#107 | Medium | grid | ||
| Word Chain#109 | Hard | string | ||
| Corridor With Demolitions#110 | Hard | grid |
Follow one path to exhaustion, then retreat and try the next.
| Status | Problem | Difficulty | Visual | Saved |
|---|---|---|---|---|
| Unlock Every Vault#93 | Easy | grid | ||
| Coastline Length#94 | Easy | grid | ||
| Count the Reefs#97 | Medium | grid |
Track which things are connected, with near-constant merges.
| Status | Problem | Difficulty | Visual | Saved |
|---|---|---|---|---|
| Is There a Route?#95 | Easy | number | ||
| Study Circles#100 | Medium | grid | ||
| The Surplus Cable#101 | Medium | grid |
Take the locally best option, when you can prove it stays best.
| Status | Problem | Difficulty | Visual | Saved |
|---|---|---|---|---|
| Best Single Trade#7 | Easy | array | ||
| Stepping Stones Across the Stream#71 | Easy | array | ||
| Portions for Appetites#72 | Easy | array | ||
| Exact Change at the Ferry Booth#73 | Easy | array | ||
| Loading the Supply Truck#74 | Easy | grid | ||
| Balanced Dance Phrases#76 | Easy | string | ||
| Forced Sign Flips#77 | Easy | array | ||
| Fewest Darts for the Banners#81 | Medium | grid | ||
| Trim the Talk Schedule#82 | Medium | grid | ||
| Where the Shuttle Should Start#84 | Medium | array | ||
| Split the Parade#85 | Medium | string | ||
| Ferrying Hikers Across the Lake#86 | Medium | array | ||
| Biggest Badge Number#87 | Medium | array | ||
| Reward Tokens for the Relay Team#88 | Hard | array | ||
| Fewest Sprinklers for the Lawn#89 | Hard | number |
Solve each overlapping subproblem once and remember the answer.
| Status | Problem | Difficulty | Visual | Saved |
|---|---|---|---|---|
| Count the Climbing Routes#48 | Easy | number | ||
| Sponsor Slot Revenue#51 | Easy | array | ||
| Stepping Stone Toll#52 | Easy | array | ||
| Routes Around the Roadworks#53 | Easy | grid | ||
| Lightest Route Across the Floor#54 | Easy | grid | ||
| Fewest Hops to the Exit#55 | Easy | array | ||
| Fewest Tokens for the Fare#56 | Easy | array | ||
| What Survived Both Edits#57 | Easy | string | ||
| Ways to Pay a Refund#58 | Medium | number | ||
| Longest Rising Streak of Readings#59 | Medium | array | ||
| Split the Cargo Evenly#60 | Medium | array | ||
| Credits and Debits#61 | Medium | array | ||
| Readings of a Pager Message#62 | Medium | string | ||
| Segment the Hashtag#63 | Medium | string | ||
| Strongest Amplifier Chain#64 | Medium | array | ||
| Largest Square Solar Panel#65 | Medium | grid | ||
| Longest Mirror Necklace#66 | Medium | string | ||
| Pack the Rucksack#67 | Medium | array | ||
| Fewest Keystroke Fixes#68 | Hard | string | ||
| Merged Chat Streams#69 | Hard | string | ||
| Trading With a Rest Day#70 | Hard | array | ||
| Cheapest Trip With Few Layovers#108 | Hard | number |
Split into independent halves, solve each, combine the results.
| Status | Problem | Difficulty | Visual | Saved |
|---|---|---|---|---|
| Fast Modular Power#129 | Medium | number |
Treat an integer as a set of flags and use the hardware directly.
| Status | Problem | Difficulty | Visual | Saved |
|---|---|---|---|---|
| The Unpaired Badge#120 | Easy | array | ||
| Set-Bit Tally#121 | Easy | number | ||
| Signal Mismatch Count#122 | Easy | number | ||
| Power-of-Two Batch Check#123 | Easy | number | ||
| Every Basket Total#124 | Medium | array | ||
| Strongest XOR Pair#125 | Hard | array | ||
| The Missing Ticket#127 | Easy | array |
Constant-time access to the extreme, logarithmic to change it.
| Status | Problem | Difficulty | Visual | Saved |
|---|---|---|---|---|
| Fewest Depot Stops#90 | Hard | number | ||
| Broadcast Delay#105 | Medium | number | ||
| Crush the Heaviest Pair#112 | Easy | array | ||
| Merge Sorted Feeds#114 | Medium | grid | ||
| Running Median of a Stream#116 | Hard | array | ||
| Cable Splicing Cost#117 | Medium | array | ||
| Oven Cooldown Schedule#118 | Medium | string | ||
| Tightest Sensor Window#119 | Hard | grid | ||
| K-th Smallest in a Sorted Grid#128 | Medium | grid |
A tree keyed by character, so shared prefixes are stored once.
| Status | Problem | Difficulty | Visual | Saved |
|---|---|---|---|---|
| Shared Label Prefix#142 | Easy | words | ||
| Prefix Tally#143 | Medium | words | ||
| Root Shorthand#144 | Medium | words |