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
- 839.Short Encoding of WordsMedium
- 842.Card Flipping GameMedium
- 843.Binary Trees With FactorsMedium
- 850.Insert into a Sorted Circular Linked ListMedium
- 851.Goat LatinEasy
- 853.Most Profit Assigning WorkMedium
- 854.Making A Large IslandHard
- 855.Count Unique Characters of All Substrings of a Given StringHard
- 857.Positions of Large GroupsEasy
- 858.Masking Personal InformationMedium
- 859.Design Circular DequeMedium
- 860.Design Circular QueueMedium
- 861.Flipping an ImageEasy
- 862.Find And Replace in StringMedium
- 863.Sum of Distances in TreeHard
- 864.Image OverlapMedium
- 865.Robot Room CleanerHard
- 867.New 21 GameMedium
- 868.Push DominoesMedium
- 869.Similar String GroupsHard
- 870.Magic Squares In GridMedium
- 871.Keys and RoomsMedium
- 872.Split Array into Fibonacci SequenceMedium
- 873.Guess the WordHard
- 875.Longest Mountain in ArrayMedium
- 876.Hand of StraightsMedium
- 877.Shortest Path Visiting All NodesHard
- 878.Shifting LettersMedium
- 879.Maximize Distance to Closest PersonMedium
- 881.Loud and RichMedium
- 882.Peak Index in a Mountain ArrayMedium
- 883.Car FleetMedium
- 884.K-Similar StringsHard
- 885.Exam RoomMedium
- 886.Score of ParenthesesMedium
- 887.Minimum Cost to Hire K WorkersHard
- 888.Mirror ReflectionMedium
- 889.Buddy StringsEasy
- 890.Lemonade ChangeEasy
- 891.Score After Flipping MatrixMedium
- 892.Shortest Subarray with Sum at Least KHard
- 893.All Nodes Distance K in Binary TreeMedium
- 894.Random Pick with BlacklistHard
- 895.Shortest Path to Get All KeysHard
- 897.Prime PalindromeMedium
- 898.Transpose MatrixEasy
- 899.Binary GapEasy
- 900.Reordered Power of 2Medium
- 905.Length of Longest Fibonacci SubsequenceMedium
- 906.Walking Robot SimulationMedium
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.