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.
432 answers
- 519.Widest Pair of Indices With Equal Range SumMedium
- 524.Longest Word in Dictionary through DeletingMedium
- 525.Contiguous ArrayMedium
- 528.Swapping Nodes in a Linked ListMedium
- 531.Lonely Pixel IMedium
- 532.K-diff Pairs in an ArrayMedium
- 533.Lonely Pixel IIMedium
- 535.Encode and Decode TinyURLMedium
- 536.Construct Binary Tree from StringMedium
- 537.Complex Number MultiplicationMedium
- 539.Minimum Time DifferenceMedium
- 542.01 MatrixMedium
- 544.Output Contest MatchesMedium
- 545.Boundary of Binary TreeMedium
- 547.Number of ProvincesMedium
- 549.Binary Tree Longest Consecutive Sequence IIMedium
- 550.Shortest Path to Get FoodMedium
- 553.Optimal DivisionMedium
- 554.Brick WallMedium
- 555.Split Concatenated StringsMedium
- 562.Longest Line of Consecutive One in MatrixMedium
- 567.Permutation in StringMedium
- 573.Squirrel SimulationMedium
- 581.Shortest Unsorted Continuous SubarrayMedium
- 582.Kill ProcessMedium
- 592.Fraction Addition and SubtractionMedium
- 593.Valid SquareMedium
- 606.Construct String from Binary TreeMedium
- 609.Find Duplicate File in SystemMedium
- 611.Valid Triangle NumberMedium
- 616.Add Bold Tag in StringMedium
- 621.Task SchedulerMedium
- 623.Add One Row to TreeMedium
- 624.Maximum Distance in ArraysMedium
- 625.Minimum FactorizationMedium
- 635.Design Log Storage SystemMedium
- 636.Exclusive Time of FunctionsMedium
- 638.Shopping OffersMedium
- 640.Solve the EquationMedium
- 646.Maximum Length of Pair ChainMedium
- 648.Replace WordsMedium
- 649.Dota2 SenateMedium
- 650.2 Keys KeyboardMedium
- 651.4 Keys KeyboardMedium
- 652.Find Duplicate SubtreesMedium
- 654.Maximum Binary TreeMedium
- 655.Print Binary TreeMedium
- 658.Find K Closest ElementsMedium
- 659.Split Array into Consecutive SubsequencesMedium
- 663.Equal Tree PartitionMedium
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.