my leetcode solutions
- 0001. Two Sum
- 0002. Add Two Numbers
- 0003. Longest Substring Without Repeating Characters
- 0004. Median of Two Sorted Arrays
- 0005. Longest Palindromic Substring
- 0007. Reverse Integer
- 0008. String to Integer (atoi)
- 0009. Palindrome Number
- 0011. Container With Most Water
- 0012. Integer to Roman
- 0013. Roman to Integer
- 0014. Longest Common Prefix
- 0017. Letter Combinations of a Phone Number
- 0020. Valid Parentheses
- 0021. Merge Two Sorted Lists
- 0022. Generate Parentheses
- 0023. Merge k Sorted Lists
- 0024. Swap Nodes in Pairs
- 0028. Implement strStr()
- 0031. Next Permutation
- 0032. Longest Valid Parentheses
- 0036. Valid Sudoku
- 0037. Sudoku Solver
- 0038. Count and Say
- 0039. Combination Sum
- 0040. Combination Sum II
- 0041. First Missing Positive
- 0046. Permutations
- 0047. Permutations II
- 0048. Rotate Image
- 0049. Group Anagrams
- 0050. Pow(x, n)
- 0051. N-Queens
- 0052. N-Queens II
- 0053. Maximum Subarray
- 0055. Jump Game
- 0056. Merge Intervals
- 0057. Insert Interval
- 0058. Length of Last Word
- 0061. Rotate List
- 0062. Unique Paths
- 0063. Unique Paths II
- 0064. Minimum Path Sum
- 0065. Valid Number
- 0066. Plus One
- 0067. Add Binary
- 0070. Climbing Stairs
- 0071. Simplify Path
- 0072. Edit Distance
- 0073. Set Matrix Zeroes
- 0075. Sort Colors
- 0076. Minimum Window Substring
- 0077. Combinations
- 0078. Subsets
- 0079. Word Search
- 0082. Remove Duplicates from Sorted List II
- 0083. Remove Duplicates from Sorted List
- 0084. Largest Rectangle in Histogram
- 0085. Maximal Rectangle
- 0090. Subsets II
- 0093. Restore IP Addresses
- 0094. Binary Tree Inorder Traversal
- 0096. Unique Binary Search Trees
- 0098. Validate Binary Search Tree
- 0100. Same Tree
- 0101. Symmetric Tree
- 0102. Binary Tree Level Order Traversal
- 0104. Maximum Depth of Binary Tree
- 0105. Construct Binary Tree from Preorder and Inorder Traversal
- 0106. Construct Binary Tree from Inorder and Postorder Traversal
- 0107. Binary Tree Level Order Traversal II
- 0108. Convert Sorted Array to Binary Search Tree
- 0109. Convert Sorted List to Binary Search Tree
- 0110. Balanced Binary Tree
- 0111. Minimum Depth of Binary Tree
- 0112. Path Sum
- 0113. Path Sum II
- 0114. Flatten Binary Tree to Linked List
- 0115. Distinct Subsequences
- 0116. Populating Next Right Pointers in Each Node
- 0117. Populating Next Right Pointers in Each Node II
- 0120. Triangle
- 0121. Best Time to Buy and Sell Stock
- 0122. Best Time to Buy and Sell Stock II
- 0123. Best Time to Buy and Sell Stock III
- 0125. Valid Palindrome
- 0128. Longest Consecutive Sequence
- 0129. Sum Root to Leaf Numbers
- 0130. Surrounded Regions
- 0131. Palindrome Partitioning
- 0132. Palindrome Partitioning II
- 0133. Clone Graph
- 0134. Gas Station
- 0135. Candy
- 0136. Single Number
- 0137. Single Number II
- 0138. Copy List with Random Pointer
- 0139. Word Break
- 0140. Word Break II
- 0141. Linked List Cycle
- 0142. Linked List Cycle II
- 0144. Binary Tree Preorder Traversal
- 0145. Binary Tree Postorder Traversal
- 0146. LRU Cache
- 0150. Evaluate Reverse Polish Notation
- 0151. Reverse Words in a String
- 0152. Maximum Product Subarray
- 0153. Find Minimum in Rotated Sorted Array
- 0154. Find Minimum in Rotated Sorted Array II
- 0155. Min Stack
- 0156. Binary Tree Upside Down
- 0157. Read N Characters Given Read4
- 0158. Read N Characters Given Read4 II - Call multiple times
- 0160. Intersection of Two Linked Lists
- 0161. One Edit Distance
- 0162. Find Peak Element
- 0163. Missing Ranges
- 0164. Maximum Gap
- 0165. Compare Version Numbers
- 0167. Two Sum II - Input array is sorted
- 0168. Excel Sheet Column Title
- 0169. Majority Element
- 0171. Excel Sheet Column Number
- 0172. Factorial Trailing Zeroes
- 0174. Dungeon Game
- 0179. Largest Number
- 0187. Repeated DNA Sequences
- 0188. Best Time to Buy and Sell Stock IV
- 0189. Rotate Array
- 0190. Reverse Bits
- 0191. Number of 1 Bits
- 0198. House Robber
- 0199. Binary Tree Right Side View
- 0200. Number of Islands
- 0201. Bitwise AND of Numbers Range
- 0202. Happy Number
- 0203. Remove Linked List Elements
- 0204. Count Primes
- 0205. Isomorphic Strings
- 0206. Reverse Linked List
- 0207. Course Schedule
- 0208. Implement Trie (Prefix Tree)
- 0209. Minimum Size Subarray Sum
- 0210. Course Schedule II
- 0211. Add and Search Word - Data structure design
- 0212. Word Search II
- 0213. House Robber II
- 0214. Shortest Palindrome
- 0215. Kth Largest Element in an Array
- 0216. Combination Sum III
- 0217. Contains Duplicate
- 0218. The Skyline Problem
- 0219. Contains Duplicate II
- 0220. Contains Duplicate III
- 0221. Maximal Square
- 0222. Count Complete Tree Nodes
- 0224. Basic Calculator
- 0225. Implement Stack using Queues
- 0226. Invert Binary Tree
- 0227. Basic Calculator II
- 0228. Summary Ranges
- 0229. Majority Element II
- 0230. Kth Smallest Element in a BST
- 0231. Power of Two
- 0232. Implement Queue using Stacks
- 0234. Palindrome Linked List
- 0235. Lowest Common Ancestor of a Binary Search Tree
- 0236. Lowest Common Ancestor of a Binary Tree
- 0237. Delete Node in a Linked List
- 0238. Product of Array Except Self
- 0239. Sliding Window Maximum
- 0240. Search a 2D Matrix II
- 0241. Different Ways to Add Parentheses
- 0242. Valid Anagram
- 0243. Shortest Word Distance
- 0244. Shortest Word Distance II
- 0245. Shortest Word Distance III
- 0246. Strobogrammatic Number
- 0249. Group Shifted Strings
- 0250. Count Univalue Subtrees
- 0251. Flatten 2D Vector
- 0252. Meeting Rooms
- 0253. Meeting Rooms II
- 0254. Factor Combinations
- 0255. Verify Preorder Sequence in Binary Search Tree
- 0256. Paint House
- 0257. Binary Tree Paths
- 0258. Add Digits
- 0260. Single Number III
- 0263. Ugly Number
- 0264. Ugly Number II
- 0265. Paint House II
- 0266. Palindrome Permutation
- 0267. Palindrome Permutation II
- 0268. Missing Number
- 0269. Alien Dictionary
- 0270. Closest Binary Search Tree Value
- 0274. H-Index
- 0275. H-Index II
- 0276. Paint Fence
- 0277. Find the Celebrity
- 0278. First Bad Version
- 0279. Perfect Squares
- 0280. Wiggle Sort
- 0283. Move Zeroes
- 0284. Peeking Iterator
- 0285. Inorder Successor in BST
- 0286. Walls and Gates
- 0287. Find the Duplicate Number
- 0288. Unique Word Abbreviation
- 0289. Game of Life
- 0290. Word Pattern
- 0292. Nim Game
- 0293. Flip Game
- 0294. Flip Game II
- 0295. Find Median from Data Stream
- 0296. Best Meeting Point
- 0297. Serialize and Deserialize Binary Tree
- 0299. Bulls and Cows
- 0300. Longest Increasing Subsequence
- 0301. Remove Invalid Parentheses
- 0303. Range Sum Query - Immutable
- 0304. Range Sum Query 2D - Immutable
- 0306. Additive Number
- 0307. Range Sum Query - Mutable.cpp
- 0310. Minimum Height Trees
- 0311. Sparse Matrix Multiplication
- 0312. Burst Balloons
- 0313. Super Ugly Number
- 0315. Count of Smaller Numbers After Self
- 0317. Shortest Distance from All Buildings
- 0318. Maximum Product of Word Lengths
- 0319. Bulb Switcher
- 0320. Generalized Abbreviation
- 0322. Coin Change
- 0324. Wiggle Sort II
- 0325. Maximum Size Subarray Sum Equals k
- 0326. Power of Three
- 0327. Count of Range Sum
- 0328. Odd Even Linked List
- 0330. Patching Array
- 0331. Verify Preorder Serialization of a Binary Tree
- 0332. Reconstruct Itinerary
- 0333. Largest BST Subtree
- 0334. Increasing Triplet Subsequence
- 0337. House Robber III
- 0338. Counting Bits
- 0339. Nested List Weight Sum
- 0340. Longest Substring with At Most K Distinct Characters
- 0341. Flatten Nested List Iterator
- 0342. Power of Four
- 0343. Integer Break
- 0344. Reverse String
- 0345. Reverse Vowels of a String
- 0346. Moving Average from Data Stream
- 0347. Top K Frequent Elements
- 0348. Design Tic-Tac-Toe
- 0349. Intersection of Two Arrays
- 0350. Intersection of Two Arrays II
- 0351. Android Unlock Patterns
- 0352. Data Stream as Disjoint Intervals
- 0354. Russian Doll Envelopes
- 0355. Design Twitter
- 0359. Logger Rate Limiter
- 0361. Bomb Enemy
- 0362. Design Hit Counter
- 0363. Max Sum of Rectangle No Larger Than K
- 0364. Nested List Weight Sum II
- 0365. Water and Jug Problem
- 0366. Find Leaves of Binary Tree
- 0367. Valid Perfect Square
- 0368. Largest Divisible Subset
- 0369. Plus One Linked List
- 0370. Range Addition
- 0371. Sum of Two Integers
- 0373. Find K Pairs with Smallest Sums
- 0374. Guess Number Higher or Lower
- 0375. Guess Number Higher or Lower II
- 0376. Wiggle Subsequence
- 0377. Combination Sum IV
- 0378. Kth Smallest Element in a Sorted Matrix
- 0379. Design Phone Directory
- 0380. Insert Delete GetRandom O(1)
- 0381. Insert Delete GetRandom O(1) - Duplicates allowed
- 0382. Linked List Random Node
- 0383. Ransom Note
- 0384. Shuffle an Array
- 0385. Mini Parser
- 0386. Lexicographical Numbers
- 0387. First Unique Character in a String
- 0388. Longest Absolute File Path
- 0389. Find the Difference
- 0390. Elimination Game
- 0392. Is Subsequence
- 0393. UTF-8 Validation
- 0394. Decode String
- 0395. Longest Substring with At Least K Repeating Characters
- 0396. Rotate Function
- 0397. Integer Replacement
- 0398. Random Pick Index
- 0399. Evaluate Division
- 0401. Binary Watch.cpp
- 0402. Remove K Digits.cpp
- 0403. Frog Jump.cpp
- 0404. Sum of Left Leaves.cpp
- 0405. Convert a Number to Hexadecimal.cpp
- 0406. Queue Reconstruction by Height.cpp
- 0407. Trapping Rain Water II.cpp
- 0408. Valid Word Abbreviation.cpp
- 0409. Longest Palindrome.cpp
- 0410. Split Array Largest Sum.cpp
- 0412. Fizz Buzz.cpp
- 0413. Arithmetic Slices.cpp
- 0414. Third Maximum Number.cpp
- 0415. Add Strings.cpp
- 0416. Partition Equal Subset Sum.cpp
- 0417. Pacific Atlantic Water Flow.cpp
- 0419. Battleships in a Board.cpp
- 0421. Maximum XOR of Two Numbers in an Array.cpp
- 0422. Valid Word Square.cpp
- 0423. Reconstruct Original Digits from English.cpp
- 0424. Longest Repeating Character Replacement.cpp
- 0425. Word Squares.cpp
- 0426. Convert Binary Search Tree to Sorted Doubly Linked List.cpp
- 0427. Construct Quad Tree.cpp
- 0428. Serialize and Deserialize N-ary Tree.cpp
- 0429. N-ary Tree Level Order Traversal.cpp
- 0430. Flatten a Multilevel Doubly Linked List.cpp
- 0431. Encode N-ary Tree to Binary Tree.cpp
- 0433. Minimum Genetic Mutation.cpp
- 0434. Number of Segments in a String.cpp
- 0435. Non-overlapping Intervals.cpp
- 0436. Find Right Interval.cpp
- 0437. Path Sum III.cpp
- 0438. Find All Anagrams in a String.cpp
- 0439. Ternary Expression Parser.cpp
- 0441. Arranging Coins.cpp
- 0442. Find All Duplicates in an Array.cpp
- 0443. String Compression.cpp
- 0445. Add Two Numbers II.cpp
- 0447. Number of Boomerangs.cpp
- 0448. Find All Numbers Disappeared in an Array.cpp
- 0449. Serialize and Deserialize BST.cpp
- 0452. Minimum Number of Arrows to Burst Balloons.cpp
- 0453. Minimum Moves to Equal Array Elements.cpp
- 0455. Assign Cookies.cpp
- 0456. 132 Pattern.cpp
- 0458. Poor Pigs.cpp
- 0459. Repeated Substring Pattern.cpp
- 0460. LFU Cache.cpp
- 0461. Hamming Distance.cpp
- 0462. Minimum Moves to Equal Array Elements II.cpp
- 0463. Island Perimeter.cpp
- 0464. Can I Win.cpp
- 0470. Implement Rand10() Using Rand7().cpp
- 0478. Generate Random Point in a Circle.cpp
- 0484. Find Permutation.cpp
- 0485. Max Consecutive Ones.cpp
- 0486. Predict the Winner.cpp
- 0487. Max Consecutive Ones II.cpp
- 0493. Reverse Pairs.cpp
- 0494. Target Sum.cpp
- 0495. Teemo Attacking
- 0504. Base 7.cpp
- 0650. 2 Keys Keyboard.cpp
- 0651. 4 Keys Keyboard.cpp
- 0654. Maximum Binary Tree
- 0695. Max Area of Island
- 0697. Degree of an Array
- 0700. Search in a Binary Search Tree
- 0701. Insert into a Binary Search Tree
- 0703. Kth Largest Element in a Stream
- 0704. Binary Search
- 0709. To Lower Case
- 0712. Minimum ASCII Delete Sum for Two Strings
- 0726. Number of Atoms
- 0729. My Calendar I
- 0739. Daily Temperatures
- 0740. Delete and Earn
- 0763. Partition Labels
- 0784. Letter Case Permutation
- 0789. Escape The Ghosts
- 0791. Custom Sort String
- 0797. All Paths From Source to Target
- 0799. Champagne Tower
- 0801. Minimum Swaps To Make Sequences Increasing
- 0802. Find Eventual Safe States
- 0804. Unique Morse Code Words
- 0806. Number of Lines To Write String
- 0807. Max Increase to Keep City Skyline
- 0820. Short Encoding of Words
- 0821. Shortest Distance to a Character
- 0822. Card Flipping Game
- 0837. New 21 Game
- 0845. Longest Mountain in Array
- 0856. Score of Parentheses
- 0859. Buddy Strings
- 0860. Lemonade Change
- 0861. Score After Flipping Matrix
- 0867. Transpose Matrix
- 0868. Binary Gap
- 0870. Advantage Shuffle
- 0875. Koko Eating Bananas
- 0877. Stone Game
- 0885. Boats to Save People
- 0895. Maximum Frequency Stack.cpp
- 0916. Word Subsets
- 0917. Reverse Only Letters
- 0921. Minimum Add to Make Parentheses Valid
- 0922. Sort Array By Parity II
- 0925. Long Pressed Name
- 0926. Flip String to Monotone Increasing
- 0928. Minimize Malware Spread II
- 0929. Unique Email Addresses
- 0931. Minimum Falling Path Sum
- 0933. Number of Recent Calls
- 0935. Knight Dialer
- 0938. Range Sum of BST
- 0940. Distinct Subsequences II
- 0941. Valid Mountain Array
- 0942. DI String Match
- 0948. Bag of Tokens
- 0949. Largest Time for Given Digits
- 0951. Flip Equivalent Binary Trees
- 0976. Largest Perimeter Triangle
- 0997. Find the Town Judge
- 0998. Maximum Binary Tree II
- 1005. Maximize Sum Of Array After K Negations
- 1006. Clumsy Factorial
- 1007. Minimum Domino Rotations For Equal Row
- 1014. Best Sightseeing Pair
- 1015. Smallest Integer Divisible by K
- 1016. Binary String With Substrings Representing 1 To N
- 1020. Partition Array Into Three Parts With Equal Sum
- 1021. Best Sightseeing Pair
- 1022. Sum of Root To Leaf Binary Numbers
- 1023. Camelcase Matching
- 1024. Video Stitching
- 1029. Binary Prefix Divisible By 5
- 1030. Next Greater Node In Linked List