Talentd
FleetCode
Make and follow sheets.Sign in

Solutions, explained

3,918 problems with a written solution. Every approach from brute force to the best one, with code in Python, Java, C++ and more.

Has video
Array2,120String854Hash Table774Math650Dynamic Programming613Sorting495Greedy462Binary Search335Depth-First Search321Database307Matrix267Bit Manipulation264All topics
Paint House

256.Paint House

MediumArrayDynamic Programming64.3% acceptance8 companiesPremium elsewhere, free hereVideo
H-Index

274.H-Index

MediumArrayCounting SortSorting41.8% acceptance8 companiesVideo
Paint Fence

276.Paint Fence

MediumDynamic Programming48.3% acceptance4 companiesPremium elsewhere, free hereVideo
Wiggle Sort

280.Wiggle Sort

MediumArrayGreedySorting68.5% acceptance4 companiesPremium elsewhere, free hereVideo
Nim Game

292.Nim Game

EasyBrainteaserGame TheoryMath60.6% acceptance6 companiesVideo
Flip Game

293.Flip Game

EasyString64.8% acceptance1 companyPremium elsewhere, free hereVideo
Flip Game II

294.Flip Game II

MediumBacktrackingDynamic ProgrammingGame Theory52.2% acceptance2 companiesPremium elsewhere, free hereVideo
Showing 251–300 of 3,918

How to use these solutions

Each solution breaks the problem into approaches, usually from brute force to the best one, and explains why each works. Code comes in Python, Java, C++ and other languages. Knowing why an approach works matters more in an interview than remembering the code.

  • Try the problem first. Give it at least 20 minutes before you open the solution.
  • Read every approach. The brute force shows you the problem; the faster ones show the pattern.
  • Check the complexity. Note the time and space of each approach and what makes the difference.
  • Write it yourself. Close the solution and code it from memory in the editor.
  • Come back in a week. Solving it again later is what makes the pattern stick.