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.
166 answers
- 243.Shortest Word DistanceEasy
- 252.Meeting RoomsEasy
- 257.Binary Tree PathsEasy
- 258.Add DigitsEasy
- 263.Ugly NumberEasy
- 268.Missing NumberEasy
- 270.Closest Binary Search Tree ValueEasy
- 278.First Bad VersionEasy
- 292.Nim GameEasy
- 303.Range Sum Query - ImmutableEasy
- 326.Power of ThreeEasy
- 338.Counting BitsEasy
- 342.Power of FourEasy
- 344.Reverse StringEasy
- 345.Reverse Vowels of a StringEasy
- 346.Moving Average from Data StreamEasy
- 349.Intersection of Two ArraysEasy
- 350.Intersection of Two Arrays IIEasy
- 359.Logger Rate LimiterEasy
- 367.Valid Perfect SquareEasy
- 374.Guess Number Higher or LowerEasy
- 387.First Unique Character in a StringEasy
- 392.Is SubsequenceEasy
- 401.Binary WatchEasy
- 404.Sum of Left LeavesEasy
- 408.Valid Word AbbreviationEasy
- 409.Longest PalindromeEasy
- 412.Fizz BuzzEasy
- 415.Add StringsEasy
- 422.Valid Word SquareEasy
- 434.Number of Segments in a StringEasy
- 441.Arranging CoinsEasy
- 448.Find All Numbers Disappeared in an ArrayEasy
- 455.Assign CookiesEasy
- 459.Repeated Substring PatternEasy
- 463.Island PerimeterEasy
- 476.Number ComplementEasy
- 482.License Key FormattingEasy
- 485.Max Consecutive OnesEasy
- 492.Construct the RectangleEasy
- 495.Teemo AttackingEasy
- 496.Next Greater Element IEasy
- 501.Find Mode in Binary Search TreeEasy
- 504.Base 7Easy
- 506.Relative RanksEasy
- 507.Perfect NumberEasy
- 520.Detect CapitalEasy
- 521.Longest Uncommon Subsequence IEasy
- 530.Minimum Absolute Difference in BSTEasy
- 541.Reverse String IIEasy
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.