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
- 650.2 Keys KeyboardMedium
- 651.4 Keys KeyboardMedium
- 652.Find Duplicate SubtreesMedium
- 653.Two Sum IV - Input is a BSTEasy
- 654.Maximum Binary TreeMedium
- 655.Print Binary TreeMedium
- 656.Coin PathHard
- 658.Find K Closest ElementsMedium
- 659.Split Array into Consecutive SubsequencesMedium
- 661.Image SmootherEasy
- 663.Equal Tree PartitionMedium
- 665.Non-decreasing ArrayMedium
- 666.Path Sum IVMedium
- 667.Beautiful Arrangement IIMedium
- 668.Kth Smallest Number in Multiplication TableHard
- 669.Trim a Binary Search TreeMedium
- 670.Maximum SwapMedium
- 671.Second Minimum Node In a Binary TreeEasy
- 672.Bulb Switcher IIMedium
- 673.Number of Longest Increasing SubsequenceMedium
- 675.Cut Off Trees for Golf EventHard
- 676.Implement Magic DictionaryMedium
- 677.Map Sum PairsMedium
- 678.Valid Parenthesis StringMedium
- 679.24 GameHard
- 680.Valid Palindrome IIEasy
- 681.Next Closest TimeMedium
- 682.Baseball GameEasy
- 683.K Empty SlotsHard
- 684.Redundant ConnectionMedium
- 685.Redundant Connection IIHard
- 686.Repeated String MatchMedium
- 687.Longest Univalue PathMedium
- 690.Employee ImportanceMedium
- 691.Stickers to Spell WordHard
- 692.Top K Frequent WordsMedium
- 693.Binary Number with Alternating BitsEasy
- 694.Number of Distinct IslandsMedium
- 695.Max Area of IslandMedium
- 696.Count Binary SubstringsEasy
- 697.Degree of an ArrayEasy
- 698.Partition to K Equal Sum SubsetsMedium
- 699.Falling SquaresHard
- 711.Number of Distinct Islands IIHard
- 712.Minimum ASCII Delete Sum for Two StringsMedium
- 713.Subarray Product Less Than KMedium
- 714.Best Time to Buy and Sell Stock with Transaction FeeMedium
- 715.Range ModuleHard
- 716.Max StackHard
- 717.1-bit and 2-bit CharactersEasy
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.