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
- 316.Remove Duplicate LettersMedium
- 318.Maximum Product of Word LengthsMedium
- 320.Generalized AbbreviationMedium
- 322.Coin ChangeMedium
- 323.Number of Connected Components in an Undirected GraphMedium
- 324.Wiggle Sort IIMedium
- 325.Maximum Size Subarray Sum Equals kMedium
- 328.Odd Even Linked ListMedium
- 331.Verify Preorder Serialization of a Binary TreeMedium
- 333.Largest BST SubtreeMedium
- 334.Increasing Triplet SubsequenceMedium
- 337.House Robber IIIMedium
- 339.Nested List Weight SumMedium
- 340.Longest Substring with At Most K Distinct CharactersMedium
- 341.Flatten Nested List IteratorMedium
- 343.Integer BreakMedium
- 347.Top K Frequent ElementsMedium
- 348.Design Tic-Tac-ToeMedium
- 351.Android Unlock PatternsMedium
- 353.Design Snake GameMedium
- 355.Design TwitterMedium
- 356.Line ReflectionMedium
- 357.Count Numbers with Unique DigitsMedium
- 360.Sort Transformed ArrayMedium
- 361.Bomb EnemyMedium
- 362.Design Hit CounterMedium
- 364.Nested List Weight Sum IIMedium
- 365.Water and Jug ProblemMedium
- 366.Find Leaves of Binary TreeMedium
- 368.Largest Divisible SubsetMedium
- 369.Plus One Linked ListMedium
- 370.Range AdditionMedium
- 371.Sum of Two IntegersMedium
- 373.Find K Pairs with Smallest SumsMedium
- 375.Guess Number Higher or Lower IIMedium
- 376.Wiggle SubsequenceMedium
- 377.Combination Sum IVMedium
- 379.Design Phone DirectoryMedium
- 380.Insert Delete GetRandom O(1)Medium
- 384.Shuffle an ArrayMedium
- 385.Mini ParserMedium
- 386.Lexicographical NumbersMedium
- 388.Longest Absolute File PathMedium
- 393.UTF-8 ValidationMedium
- 395.Longest Substring with At Least K Repeating CharactersMedium
- 396.Rotate FunctionMedium
- 397.Integer ReplacementMedium
- 398.Random Pick IndexMedium
- 399.Evaluate DivisionMedium
- 400.Nth DigitMedium
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.