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
- 773.Logical OR of Two Binary Grids Represented as Quad-TreesMedium
- 775.N-ary Tree Preorder TraversalEasy
- 776.N-ary Tree Postorder TraversalEasy
- 777.Toeplitz MatrixEasy
- 778.Reorganize StringMedium
- 779.Max Chunks To Make Sorted IIHard
- 780.Max Chunks To Make SortedMedium
- 781.Basic Calculator IVHard
- 783.Search in a Binary Search TreeEasy
- 784.Insert into a Binary Search TreeMedium
- 785.Basic Calculator IIIHard
- 786.Search in a Sorted Array of Unknown SizeMedium
- 787.Sliding PuzzleHard
- 789.Kth Largest Element in a StreamEasy
- 791.Split BSTMedium
- 792.Binary SearchEasy
- 793.Swap Adjacent in LR StringMedium
- 795.K-th Symbol in GrammarMedium
- 797.Rabbits in ForestMedium
- 798.Transform to ChessboardHard
- 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
- 809.Preimage Size of Factorial Zeroes FunctionHard
- 810.Valid Tic-Tac-Toe StateMedium
- 811.Number of Subarrays with Bounded MaximumMedium
- 813.All Paths From Source to TargetMedium
- 814.Smallest Rotation with Highest ScoreHard
- 816.Design HashSetEasy
- 817.Design HashMapEasy
- 818.Similar RGB ColorEasy
- 819.Minimum Swaps To Make Sequences IncreasingHard
- 822.Unique Morse Code WordsEasy
- 823.Split Array With Same AverageHard
- 824.Number of Lines To Write StringEasy
- 826.Soup ServingsMedium
- 827.Expressive WordsMedium
- 828.Chalkboard XOR GameHard
- 829.Subdomain Visit CountMedium
- 830.Largest Triangle AreaEasy
- 832.Binary Tree PruningMedium
- 833.Bus RoutesHard
- 834.Ambiguous CoordinatesMedium
- 835.Linked List ComponentsMedium
- 836.Race CarHard
- 837.Most Common WordEasy
- 838.Design Linked ListMedium
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.