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
- 359.Logger Rate LimiterEasy
- 360.Sort Transformed ArrayMedium
- 361.Bomb EnemyMedium
- 362.Design Hit CounterMedium
- 363.Max Sum of Rectangle No Larger Than KHard
- 364.Nested List Weight Sum IIMedium
- 365.Water and Jug ProblemMedium
- 366.Find Leaves of Binary TreeMedium
- 367.Valid Perfect SquareEasy
- 368.Largest Divisible SubsetMedium
- 369.Plus One Linked ListMedium
- 370.Range AdditionMedium
- 371.Sum of Two IntegersMedium
- 373.Find K Pairs with Smallest SumsMedium
- 374.Guess Number Higher or LowerEasy
- 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
- 387.First Unique Character in a StringEasy
- 388.Longest Absolute File PathMedium
- 391.Perfect RectangleHard
- 392.Is SubsequenceEasy
- 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
- 401.Binary WatchEasy
- 402.Remove K DigitsMedium
- 403.Frog JumpHard
- 404.Sum of Left LeavesEasy
- 406.Queue Reconstruction by HeightMedium
- 407.Trapping Rain Water IIHard
- 408.Valid Word AbbreviationEasy
- 409.Longest PalindromeEasy
- 411.Minimum Unique Word AbbreviationHard
- 412.Fizz BuzzEasy
- 415.Add StringsEasy
- 416.Partition Equal Subset SumMedium
- 418.Sentence Screen FittingMedium
- 419.Battleships in a BoardMedium
- 420.Strong Password CheckerHard
- 421.Maximum XOR of Two Numbers in an ArrayMedium
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.