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
- 780.Max Chunks To Make SortedMedium
- 784.Insert into a Binary Search TreeMedium
- 786.Search in a Sorted Array of Unknown SizeMedium
- 791.Split BSTMedium
- 793.Swap Adjacent in LR StringMedium
- 795.K-th Symbol in GrammarMedium
- 797.Rabbits in ForestMedium
- 800.Letter Case PermutationMedium
- 802.K-th Smallest Prime FractionMedium
- 803.Cheapest Flights Within K StopsMedium
- 804.Rotated DigitsMedium
- 805.Escape The GhostsMedium
- 807.Custom Sort StringMedium
- 810.Valid Tic-Tac-Toe StateMedium
- 811.Number of Subarrays with Bounded MaximumMedium
- 813.All Paths From Source to TargetMedium
- 826.Soup ServingsMedium
- 827.Expressive WordsMedium
- 829.Subdomain Visit CountMedium
- 832.Binary Tree PruningMedium
- 834.Ambiguous CoordinatesMedium
- 835.Linked List ComponentsMedium
- 838.Design Linked ListMedium
- 839.Short Encoding of WordsMedium
- 842.Card Flipping GameMedium
- 843.Binary Trees With FactorsMedium
- 850.Insert into a Sorted Circular Linked ListMedium
- 853.Most Profit Assigning WorkMedium
- 858.Masking Personal InformationMedium
- 859.Design Circular DequeMedium
- 860.Design Circular QueueMedium
- 862.Find And Replace in StringMedium
- 864.Image OverlapMedium
- 867.New 21 GameMedium
- 868.Push DominoesMedium
- 870.Magic Squares In GridMedium
- 871.Keys and RoomsMedium
- 872.Split Array into Fibonacci SequenceMedium
- 875.Longest Mountain in ArrayMedium
- 876.Hand of StraightsMedium
- 878.Shifting LettersMedium
- 879.Maximize Distance to Closest PersonMedium
- 881.Loud and RichMedium
- 882.Peak Index in a Mountain ArrayMedium
- 883.Car FleetMedium
- 885.Exam RoomMedium
- 886.Score of ParenthesesMedium
- 888.Mirror ReflectionMedium
- 891.Score After Flipping MatrixMedium
- 893.All Nodes Distance K in Binary TreeMedium
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.