This repository contains awesome LeetCode problems and solutions written in Python to prepare for coding interviews.
- 1 Two Sum
- 2 Add Two Numbers
- 6 Zigzag Conversion
- 9 Palindrome Number
- 11 Container With Most Water
- 12 Integer to Roman
- 13 Roman to Integer
- 14 Longest Common Prefix
- 15 3Sum
- 19 Remove Nth Node From End of List
- 20 Valid Parentheses
- 21 Merge Two Sorted Lists
- 25 Reverse Nodes in k-Group
- 26 Remove Duplicates from Sorted Array
- 27 Remove Element
- 28 Find the Index of the First Occurrence in a String
- 42 Trapping Rain Water
- 45 Jump Game II
- 49 Group Anagrams
- 50 Pow(x_n)
- 55 Jump Game
- 58 Length of Last Word
- 56 Merge Intervals
- 57 Insert Interval
- 61 Rotate List
- 66 Plus One
- 67 Add Binary
- 68 Text Justification
- 69 Sqrt(x)
- 71 Simplify Path
- 80 Remove Duplicates from Sorted Array II
- 82 Remove Duplicates from Sorted List II
- 86 Partition List
- 88 Merge Sorted Array
- 92 Reverse Linked List II
- 98 Validate Binary Search Tree
- 100 Same Tree
- 101 Symmetric Tree
- 102 Binary Tree Level Order Traversal
- 103 Binary Tree Zigzag Level Order Traversal
- 104 Maximum Depth of Binary Tree
- 105 Construct Binary Tree from Preorder and Inorder Traversal
- 106 Construct Binary Tree from Inorder and Postorder Traversal
- 112 Path Sum
- 114 Flatten Binary Tree to Linked List
- 117 Populating Next Right Pointers in Each Node II
- 121 Best Time to Buy and Sell Stock
- 122 Best Time to Buy and Sell Stock II
- 124 Binary Tree Maximum Path Sum
- 125 Valid Palindrome
- 127 Word Ladder
- 128 Longest Consecutive Sequence
- 129 Sum Root to Leaf Numbers
- 130 Surrounded Regions
- 133 Clone Graph
- 134 Gas Station
- 135 Candy
- 136 Single Number
- 137 Single Number II
- 138 Copy List with Random Pointer
- 141 Linked List Cycle
- 146 LRU Cache
- 149 Max Points on a Line
- 150 Evaluate Reverse Polish Notation
- 151 Reverse Words in a String
- 155 Min Stack
- 167 Two Sum II - Input Array Is Sorted
- 169 Majority Element
- 172 Factorial Trailing Zeroes
- 173 Binary Search Tree Iterator
- 189 Rotate Array
- 190 Reverse Bits
- 191 Number of 1 Bits
- 199 Binary Tree Right Side View
- 200 Number of Islands
- 201 Bitwise AND of Numbers Range
- 202 Happy Number
- 205 Isomorphic Strings
- 207 Course Schedule
- 210 Course Schedule
- 219 Contains Duplicates II
- 222 Count Complete Tree Nodes
- 224 Basic Calculator
- 226 Invert Binary Tree
- 227 Basic Calculator II
- 228 Summary Ranges
- 230 Kth Smallest Element in a BST
- 236 Lowest Common Ancestor of a Binary Tree
- 238 Product of Array Except Self
- 242 Valid Anagram
- 274 H-Index
- 290 Word Pattern
- 380 Insert Delete GetRandom O(1)
- 383 Ransom Note
- 392 Is Subsequence
- 399 Evaluate Division
- 433 Minimum Genetic Mutation
- 452 Minimum Number of Arrows to Burst Balloons
- 530 Minimum Absolute Difference in BST
- 637 Average of Levels in Binary Tree
- 909 Snakes and Ladders
Contributions are welcome!
Please fork the repository and submit a pull request.
Make sure to follow the coding standards and write tests for any new leetcode problem or bug fix.