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
- 305.Number of Islands IIHard
- 306.Additive NumberMedium
- 308.Range Sum Query 2D - MutableMedium
- 309.Best Time to Buy and Sell Stock with CooldownMedium
- 311.Sparse Matrix MultiplicationMedium
- 312.Burst BalloonsHard
- 313.Super Ugly NumberMedium
- 314.Binary Tree Vertical Order TraversalMedium
- 315.Count of Smaller Numbers After SelfHard
- 316.Remove Duplicate LettersMedium
- 317.Shortest Distance from All BuildingsHard
- 318.Maximum Product of Word LengthsMedium
- 320.Generalized AbbreviationMedium
- 321.Create Maximum NumberHard
- 322.Coin ChangeMedium
- 323.Number of Connected Components in an Undirected GraphMedium
- 324.Wiggle Sort IIMedium
- 325.Maximum Size Subarray Sum Equals kMedium
- 326.Power of ThreeEasy
- 327.Count of Range SumHard
- 328.Odd Even Linked ListMedium
- 329.Longest Increasing Path in a MatrixHard
- 331.Verify Preorder Serialization of a Binary TreeMedium
- 332.Reconstruct ItineraryHard
- 333.Largest BST SubtreeMedium
- 334.Increasing Triplet SubsequenceMedium
- 335.Self CrossingHard
- 336.Palindrome PairsHard
- 337.House Robber IIIMedium
- 338.Counting BitsEasy
- 339.Nested List Weight SumMedium
- 340.Longest Substring with At Most K Distinct CharactersMedium
- 341.Flatten Nested List IteratorMedium
- 342.Power of FourEasy
- 343.Integer BreakMedium
- 344.Reverse StringEasy
- 345.Reverse Vowels of a StringEasy
- 346.Moving Average from Data StreamEasy
- 347.Top K Frequent ElementsMedium
- 348.Design Tic-Tac-ToeMedium
- 349.Intersection of Two ArraysEasy
- 350.Intersection of Two Arrays IIEasy
- 351.Android Unlock PatternsMedium
- 352.Data Stream as Disjoint IntervalsHard
- 353.Design Snake GameMedium
- 354.Russian Doll EnvelopesHard
- 355.Design TwitterMedium
- 356.Line ReflectionMedium
- 357.Count Numbers with Unique DigitsMedium
- 358.Rearrange String k Distance ApartHard
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.