LeetCode exercises Personal repository for data structures and algorithm solutions in LeetCode.
- Blind 75 Must Do
- Top Interview Question, also you can look at the list directly in LeetCode
- Facebook Recruiting Portal training
- array
- 1. two sum
- 4. median of two sorted arrays
- 6. zigzag conversion
- 11. container with most water
- 15. 3sum
- 18. 4 sum
- 26. remove duplicates from sorted array
- 27. remove element
- 31. next permutation
- 41. first missing positive
- 53. maximum subarray
- 56. merge intervals
- 57. insert interval
- 66. plus one
- 80. remove duplicates from sorted array ii
- 88. merge sorted array
- 134. gas station
- 136. single number
- 151. reverse words in a string
- 162. two sum ii input array is sorted
- 169. majority element
- 189. rotate array
- 209. minimum size subarray sum
- 215. kth largest element in an array
- 217. contains duplicate
- 218. the skyline problem
- 228. summary ranges
- 238. product of array except self
- 239. sliding window maximum
- 260. single number iii
- 268. missing number
- 283. move zeroes
- 295. find median from data stream
- 307. range sum query mutable
- 324. wiggle sort ii
- 334. increasing triplet sequence
- 349. intersection of two arrays
- 350. intersection of two arrays ii
- 373. find k pairs with smallest sums
- 387. first unique character in a string
- 406. queue reconstruction by height
- 416. partition equal subset sum
- 442. find all duplicates in an array
- 448. find all numbers disappeared in array
- 452. minimum number of arrows to burst balloons
- 454. 4sum ii
- 462. minimum moves to equal array elements ii
- 480. sliding window median
- 494. target sum
- 525. contiguous array
- 532. k diff pairs in an array
- 539. minimum time difference
- 560. subarray sum equals k
- 605. can place flowers
- 621. task scheduler
- 658. find k closest elements
- 703. kth largest element in stream
- 715. range module
- 729. my calendar i
- 731. my calendar ii
- 849. maximize distance to closest person
- 881. boats to save people
- 922. sort array by parity ii
- 923. 3sum with multiplicity
- 941. valid mountain array
- 953. verifying an alien dictionary
- 973. k closest points to origin
- 977. squares of a sorted array
- 978. longest turbulent subarray
- 1007. minimum domino rotations for equal row
- 1010. pairs of songs with total durations divisible by 60
- 1029. two city scheduling
- 1046. last stone weight
- 1094. car pooling
- 1460. make two arrays equal by reversing sub arrays
- 1480. running sum of 1d array
- 1570. dot product of two sparse vectors
- 1610. maximum number of visible points
- 1642. furthest building you can reach
- 1769. minimum number of operations to move all balls to each box
- 2013. detect squares
- 2158. amount of new area painted each day
- binary search
- 33. search in rotated sorted array
- 34. find first and last position of element in sorted array
- 35. search insert position
- 50. pow x n
- 69. sqrt x
- 74. search a 2d matrix
- 81. search in rotated array ii
- 114. flatten binary tree to linked list
- 153. find minimum in rotated sorted array
- 154. find minimum in rotated sorted array ii
- 441. arranging coins
- 540. single element in a sorted array
- 668. kth smallest number in multiplication table
- 875. koko eating bananas
- 1011. capacity to ship packages within d days
- 1146. snapshot array
- binary tree
- 94. binary tree inorder traversal
- 96. unique binary search trees
- 98. validate binary tree
- 100. same tree
- 101. symmetric tree
- 102. binary tree level order traversal
- 103. binary tree zigzag level order traversal
- 104. maximum depth binary tree
- 105. binary tree from preorder inorder
- 106. construct binary tree from inorder and postorder traversal
- 108. convert sorted array to bst
- 111. minimum depth of binary tree
- 112. path sum
- 116. populating next right pointers in each node
- 117. populating next right pointers in each node ii
- 124. binary tree maximum path sum
- 173. binary search tree iterator
- 199. binary tree right side view
- 222. count complete tree nodes
- 226. invert binary tree
- 235. lowest comment ancestor of bst
- 297. serialize and deserialize binary tree
- 314. binary tree vertical order traversal
- 337. house robber iii
- 366. find leaves of binary tree
- 404. sum of left leaves
- 437. path sum iii
- 450. delete node in bst
- 510. inorder successor in bst ii
- 543. diameter of binary tree
- 687. longest univalue path
- 700. search in a binary search tree
- 701. insert into a binary search tree
- 823. binary tree with factors
- 938. range sum of bst
- 968. binary tree cameras
- 987. vertical order traversal of a binary tree
- 993. cousins in binary tree
- 1008. construct binary search tree from preorder traversal
- 1022. sum of root to leaf binary numbers
- 1305. all elements in two binary search trees
- 1650. lowest common ancestor of a binary tree iii
- 2096. step-by-step-directions-from-a-binary-tree-to-another
- bit manipulation
- dynamic programming
- 10. regular expression matching
- 42. trapping water
- 62. unique paths
- 87. scramble string
- 118. pascal triangle
- 121. best time buy and sell stock
- 122. best time to buy and sell stock ii
- 174. dungeon game
- 198. house robber
- 204. count primes
- 309. best time to buy and sell stock with cooldown
- 354. russian doll envelopes
- 392. is subsequence
- 473. matchsticks to square
- 474. ones and zeroes
- 764. largest plus sign
- 1473. paint house iii
- position
- sequence
- graph search
- 22. generate parentheses
- 51. n queens
- 52. n queens ii
- 79. word search
- 89. gray code
- 126. word ladder ii
- 127. word ladder
- 130. surrounded regions
- 133. clone graph
- 200. number of islands
- 207. course schedule
- 210. course schedule ii
- 247. strobogrammatic number ii
- 282. expression add operators
- 310. minimum height trees
- 329. longest increasing path in a matrix
- 489. robot room cleaner
- 562. longest line of consecutive one in matrix
- 576. out of boundary paths
- 695. max area of island
- 743. network delay time
- 778. swim in rising water
- 785. is graph bipartite
- 797. all paths from source to target
- 818. race car
- 952. largest components size by common factor
- 994. rotting oranges
- 997. find the town judge
- 1041. robot bounded in circle
- 1091. shortest path in binary matrix
- 1101. the earliest moment when everyone become friends
- 1192. critical connections in a network
- 1219. path with maximum gold
- 1293. shortest path in a grid with obstacles elimination
- 1345. jump game iv
- 1463. cherry pickup ii
- 1506. find root n-ary tree
- 2115. find all possible recipes from given supplies
- 882. reachable nodes in subdivided graph
- linked list
- 2. add two numbers
- 3. longest substring without repeating characters
- 19. remove nth node from end list
- 21. merge two sorted lists
- 23. merge k sorted lists
- 25. reverse nodes in k group
- 61. rotate list
- 82. remove duplicates from sorted list ii
- 83. remove duplicates from sorted list
- 86. partition list
- 92. reverse linked list ii
- 138. copy list with random pointer
- 141. linked list cycle
- 142. linked list cycle ii
- 143. reorder list
- 147. insertion sort list
- 148. sort list
- 160. intersection of two linked lists
- 203. remove linked list elements
- 206. reverse linked list
- 234. palindrome linked list
- 237. delete node in a linked list
- 380. insert delete getrandom
- 382. linked list random node
- 445. add two numbers ii
- 725. split linked list in parts
- 1721. swapping nodes in a linked list
- matrix
- 36. valid sudoku
- 37. sudoku solver
- 48. rotate image
- 54. spiral matrix
- 59. spiral matrix ii
- 73. set matrix zeroes
- 85. maximal rectangle
- 221. maximal square
- 240. search a 2d matrix ii
- 304. range sum query 2d immutable
- 378. kth smallest element in a sorted matrix
- 463. island perimeter
- 782. transform to chessboard
- 939. minimum area rectangle
- 986. interval list intersections
- 1074. number of submatrices that sum to target
- 1260. shift 2d grid
- 1672. richest customer wealth
- 2128. remove all ones with row and column flips
- numbers
- 7. reverse integer
- 9. palindrome number
- 38. count and say
- 149. max points on line
- 166. fraction to recurring decimal
- 172. factorial trailing zeroes
- 179. largest number
- 202. happy number
- 258. add digits
- 296. best meeting point
- 326. power of three
- 342. power of four
- 374. guess number higher or lower
- 509. fibonacci number
- 528. random pick with weight
- 858. mirror reflection
- 1088. confusing number ii
- 1137. nth tribonacci number
- 1291. sequential digits
- 2034. stock price fluctuation
- 2178. maximum split of positive even integers
- permutation and combination
- problems
- blind 75 must do
- 139. word break
- 143. reorder list
- 152. maximum product subarray
- 212. words search 2
- 213. house robber 2
- 230. kth smallest element in bst
- 236. lowest common ancestor of binary tree
- 300. longest increasing subsequence
- 322. coin change
- 347. top k frequent elements
- 417. pacific atlantic water flow
- 424. longest repeating character replacement
- 435. non overlapping intervals
- 449. serialize deserialize bst
- facebook recruiting portal
- must do easy questions
- 20. valid parentheses
- 101. linked list cycle
- 198. house robber
- 205. isomorphic strings
- 371. sum of two integers
- 557. reverse words in a string iii
- 572. subtree of another tree
- 589. n-ary tree preorder traversal
- 617. merge two binary trees
- 665. non decreasing array
- 669. trim binary search tree
- 674. longest continous increasing subsequence
- 705. design hashset
- 852. peak index mountain array
- 1160. find words that can be formed characters
- top interview questions
- 16. 3sum closest
- 17. letter combinations of a phone number
- 24. swap nodes in pairs
- 75. sort colors
- 146. lru cache
- 162. find peak element
- 215. kth largest element in array
- 279. perfect squares
- 287. find the duplicate number
- 289. game of life
- 328. odd even linked list
- 341. flatten nest list iterator
- 384. shuffle an array
- 395. longest substring at least k repeating characters
- 1335. minimum difficulty of a job schedule
- 1379. find a corresponding node of bt in a clone
- 1689. partitioning into minimum number of decibinary numbers
- blind 75 must do
- regex
- stack
- 20. valid parentheses
- 32. longest valid parentheses
- 84. largest rectangle in histogram
- 150. evaluate reverse polish notation
- 155. min stack
- 224. basic calculator
- 227. basic calculator ii
- 232. implement queue using stacks
- 315. count of smaller numbers after self
- 394. decode strings
- 739. daily temperatures
- 856. score of parentheses
- 946. validate stack sequences
- 1249. minimum remove to make valid parentheses
- 1762. buildings with an ocean view
- string
- 3. longest substring without repeating characters
- 5. longest palindromic substring
- 8. string to integer atoi
- 12. integer to roman
- 13. roman to integer
- 14. longest common prefix
- 28. implement strStr
- 30. substring with concatenation of all words
- 43. multiply strings
- 44. wildcard matching
- 49. group anagrams
- 58. length of last word
- 67. add binary
- 68. text justification
- 71. simplify path
- 76. minimum window substring
- 125. valid palindrome
- 131. palindrome partitioning
- 140. word break ii
- 165. compare version numbers
- 171. excel sheet column number
- 242. valid anagram
- 290. word pattern
- 316. remove duplicate letters
- 344. reverse string
- 359. logger rate limiter
- 389. find the difference
- 394. decode string
- 408. valid word abbreviation
- 412. fizz buzz
- 438. find all anagrams in a string
- 451. sort characters by frequency
- 520. detect capital
- 567. permutation in string
- 583. delete operation for two strings
- 647. palindromic substrings
- 680. valid palindrome ii
- 763. partition labels
- 777. swap adjacent in LR string
- 809. expressive words
- 833. find and replace in string
- 843. guess the word
- 890. find and replace pattern
- 916. word subsets
- 917. reverse only letters
- 925. long pressed name
- 936. stamping the sequence
- 1048. longest string chain
- 1055. shortest way to form string
- 1189. maximum number of ballons
- 1328. break a palindrome
- 1332. remove palindromic subsequences
- 1663. smallest string with a given numeric value
- 2135. count words obtained after adding a letter
- trie