LeetCode
LeetCode Question Answers
How to solve LeetCode problems in a coding interview: the idea behind each solution and a working answer in Python, Java, C++ and TypeScript. Open the original problem on LeetCode, try it yourself, then compare with our answer. New answers are added every day.
754 answers
- 549.Binary Tree Longest Consecutive Sequence IIMedium
- 550.Shortest Path to Get FoodMedium
- 551.Student Attendance Record IEasy
- 552.Student Attendance Record IIHard
- 553.Optimal DivisionMedium
- 554.Brick WallMedium
- 555.Split Concatenated StringsMedium
- 557.Reverse Words in a String IIIEasy
- 562.Longest Line of Consecutive One in MatrixMedium
- 563.Binary Tree TiltEasy
- 564.Find the Closest PalindromeHard
- 566.Reshape the MatrixEasy
- 567.Permutation in StringMedium
- 568.Maximum Vacation DaysHard
- 573.Squirrel SimulationMedium
- 575.Distribute CandiesEasy
- 581.Shortest Unsorted Continuous SubarrayMedium
- 582.Kill ProcessMedium
- 587.Erect the FenceHard
- 588.Design In-Memory File SystemHard
- 592.Fraction Addition and SubtractionMedium
- 593.Valid SquareMedium
- 594.Longest Harmonious SubsequenceEasy
- 598.Range Addition IIEasy
- 600.Non-negative Integers without Consecutive OnesHard
- 606.Construct String from Binary TreeMedium
- 609.Find Duplicate File in SystemMedium
- 611.Valid Triangle NumberMedium
- 616.Add Bold Tag in StringMedium
- 617.Merge Two Binary TreesEasy
- 621.Task SchedulerMedium
- 623.Add One Row to TreeMedium
- 624.Maximum Distance in ArraysMedium
- 625.Minimum FactorizationMedium
- 628.Maximum Product of Three NumbersEasy
- 629.K Inverse Pairs ArrayHard
- 630.Course Schedule IIIHard
- 631.Design Excel Sum FormulaHard
- 635.Design Log Storage SystemMedium
- 636.Exclusive Time of FunctionsMedium
- 637.Average of Levels in Binary TreeEasy
- 638.Shopping OffersMedium
- 639.Decode Ways IIHard
- 640.Solve the EquationMedium
- 642.Design Search Autocomplete SystemHard
- 644.Maximum Average Subarray IIHard
- 645.Set MismatchEasy
- 646.Maximum Length of Pair ChainMedium
- 648.Replace WordsMedium
- 649.Dota2 SenateMedium
Beyond LeetCode
Real interviews also test system design, SQL, machine learning and behavioral answers. Practise those with KatInterview problems, browse by topic, or read our company interview guides.
LeetCode is a trademark of LeetCode LLC. KatInterview is not affiliated with LeetCode.