/LeetCode

leetcode的练习记录

GNU General Public License v3.0GPL-3.0

LeetCode (709/2356)Easy 227--Medium 383--Hard 97

Algorithm exercises 🚨🚨🚨

my homepage in leetcode.com

my homepage in leetcode.com-cn

the following problem is choose by:

the problem of Daily Challenges and Weekly Contest, and the similar problem on leetcode.com and leetcode-cn.com.


Book


----SameQuestionGroup----


Tag Progress
Array 141/287
Backtracking 28/57
Binary Indexed Tree 2/6
Binary Search 42/91
Binary Search Tree 2/15
Bit Manipulation 21/54
Brainteaser 4/7
Breadth-first Search 24/74
Concurrency 1/9
Counting 25/86
Database 3/112
Depth-first Search 61/134
Desigin 11/55
Divide and Conquer 8/19
Dynamic Programming 83/222
Geometry 3/9
Graph 18/47
Greedy 39/100
Hash Table 50/133
Heap 10/35
Linked List 30/39
Math 47/122
Memoization 1/1
Minimax 3/8
Ordered Map 3/12
Queue 3/9
Recursion 5/15
Rejection Sampling 1/2
Random 3/6
Rolling Hash 1/3
Segment Tree 4/14
Sliding Window 7/25
Sort 32/52
Stack 26/57
String 87/199
Topological Sort 4/7
Tree 81/148
Trie 8/17
Two Pointers 38/60
Union Find 12/32
other 8/?

Title Tags Difficulty
1. Two Sum Array
HashTable
Easy
2. Add Two Numbers Math
LinkedList
Medium
3.Longest Substring Without Repeating Characters String
Two Pointers
HashTables
Sliding Window
Medium
4. Median of Two Sorted Arrays.md🚨 Array
Binary Serach
Divide and Conquer
Hard
5. Longest Palindromic Substring🚨 String
Dynamic Programming
Medium
6. ZigZag Conversion String Medium
7. Reverse Integer Math Easy
8. String to Integer (atoi) String
Math
Medium
9. Palindrome Number Math Easy
10. Regular Expression Matching🚨 String
Dynamic Programming
BackTracking
Hard
11. Container With Most Water Array
Two Pointer
Medium
12. Integer to Roman Math
String
Medium
13. Roman to Integer Math
String
Easy
14. Longest Common Prefix String Easy
15. 3Sum 🚨 Array
Two Pointer
Medium
16. 3Sum Closest Array
Two Pointer
Medium
17. Letter Combinations of a Phone Number String
BackTracking
Medium
18. 4Sum 🚨 Array
Two Pointer
HashTable
Medium
19. Remove Nth Node From End of List LinkedList
Two Pointers
Medium
20. Valid Parentheses String
Stack
Easy
21. Merge Two Sorted Lists LinkedList Easy
22. Generate Parentheses String
BackTracking
Medium
23.Merge k Sorted Lists LinkedList
Divide and Conquer
Heap
Hard
24. Swap Nodes in Pairs LinkedList Medium
25. Reverse Nodes in k-Group LinkedList Hard
26. Remove Duplicates from Sorted Array Array
Two Pointer
Easy
27. Remove Element Array
Two Pointer
Easy
28. Implement strStr() String
Two Pointers
Easy
31. Next Permutation 🚨 Array Medium
32. Longest Valid Parentheses🚨 String
Dynamic Programming
Hard
33. Search in Rotated Sorted Array 🚨 Array
Binary Serach
Medium
34. Find First and Last Position of Element in Sorted Array 🚨 Array
Binary Serach
Medium
35. Search Insert Position Array
Binary Serach
Easy
36. Valid Sudoku HashTable Medium
37. Sudoku Solver HashTable
Backtracking
Hard
38. Count and Say String Easy
39. Combination Sum Array
Backtracking
Medium
40. Combination Sum II Array
Backtracking
Medium
41. First Missing Positive🚨 Array Hard
43. Multiply Strings Math
String
Medium
44. Wildcard Matching String
Dynamic Programming
Greedy
Backtracking
Hard
46. Permutations Backtracking Medium
47. Permutations II Backtracking Medium
48. Rotate Image Array Medium
49. Group Anagrams String
HashTable
Medium
50. Pow(x, n) Math
BinarySearch
Medium
51. N-Queens Backtracking Hard
52. N-Queens II Backtracking Hard
53. Maximum Subarray Array
Divide and Conquer
Dynamic Programming
Easy
54. Spiral Matrix Array Medium
56. Merge Intervals Sort
Array
Medium
57. Insert Interval Array
Sort
Medium
58. Length of Last Word String Easy
59. Spiral Matrix II Array Medium
60. Permutation Sequence Math
Backtracking
Hard
61. Rotate List LinkedList
Two Pointers
Medium
62. Unique Paths Array
Dynamic Programming
Medium
63. Unique Paths II Array
Dynamic Programming
Medium
64. Minimum Path Sum Array
Dynamic Programming
Medium
65. Valid Number String
Math
Hard
66. Plus One Array Easy
67. Add Binary Math
String
Easy
70. Climbing Stairs Dynamic Programming Easy
73. Set Matrix Zeroes Array Medium
74. Search a 2D Matrix Array
Binary Search
Medium
75. Sort Colors Array
Two Pointer
Sort
Medium
77. Combinations Backtracking Medium
78. Subsets Array
Backtracking
Bit Manipulation
Medium
79. Word Search Array
BackTracking
Medium
80. Remove Duplicates from Sorted Array II Array
Two Pointers
Medium
81. Search in Rotated Sorted Array II Array
BinarySearch
Medium
82. Remove Duplicates from Sorted List II LinkedList Medium
83. Remove Duplicates from Sorted List LinkedList Easy
84. Largest Rectangle in Histogram 🚨🚨 Array
Stack
Hard
86. Partition List LinkedList
Two Pointers
Medium
88. Merge Sorted Array Array
Two Pointers
Easy
91. Decode Ways Dynamic Programming
String
Medium
92. Reverse Linked List II LinkedList Medium
93. Restore IP Addresses String
Backtracking
Medium
94. Binary Tree Inorder Traversal Stack
HashTable
Tree
Medium
95. Unique Binary Search Trees II Tree
Dynamic Programming
Medium
96. Unique Binary Search Trees Tree
Dynamic Programming
Medium
97. Interleaving String String
Dynamic Programming
Hard
98. Validate Binary Search Tree Tree
DFS
Medium
99. Recover Binary Search Tree DFS
Tree
Hard
100. Same Tree DFS
Tree
Easy
101. Symmetric Tree DFS
BFS
Tree
Easy
102. Binary Tree Level Order Traversal Tree
BFS
Medium
103. Binary Tree Zigzag Level Order Traversal Tree
BFS
Stack
Medium
104. Maximum Depth of Binary Tree DFS
Tree
Easy
105. Construct Binary Tree from Preorder and Inorder Traversal Tree
Array
DFS
Medium
106. Construct Binary Tree from Inorder and Postorder Traversal Tree
Array
DFS
Medium
107. Binary Tree Level Order Traversal II Tree
BFS
Easy
108. Convert Sorted Array to Binary Search Tree DFS
Tree
Easy
109. Convert Sorted List to Binary Search Tree LinkedList
DFS
Medium
110. Balanced Binary Tree Tree
DFS
Easy
111. Minimum Depth of Binary Tree Tree
DFS
BFS
Easy
112. Path Sum DFS
Tree
Easy
113. Path Sum II Tree
DFS
Medium
114. Flatten Binary Tree to Linked List Tree
DFS
Medium
116. Populating Next Right Pointers in Each Node DFS
Tree
Medium
117. Populating Next Right Pointers in Each Node II Tree
DFS
Medium
118. Pascal's Triangle Array Easy
119. Pascal's Triangle II Array Easy
120. Triangle Array
Dynamic Programming
Medium
121. Best Time to Buy and Sell Stock Array
Dynamic Programming
Easy
122. Best Time to Buy and Sell Stock II Array
Greedy
Easy
123. Best Time to Buy and Sell Stock III Array
Dynamic Programming
Hard
124. Binary Tree Maximum Path Sum DFS
Tree
Hard
125. Valid Palindrome String
Two Pointer
Easy
126. Word Ladder II 🚨 Array
Backtracking
String
BFS
Hard
127. Word Ladder 🚨 BFS Medium
128. Longest Consecutive Sequence 🚨 Array
Union Find
Hard
129. Sum Root to Leaf Numbers DFS
Tree
Medium
130. Surrounded Regions DFS
BFS
Union Find
Medium
131. Palindrome Partitioning DynamicProgramming
Backtracking
DFS
Medium
132. Palindrome Partitioning II Dynamic Programming Hard
133. Clone Graph DFS
BFS
Graph
Medium
134. Gas Station Greedy Medium
136. Single Number HashTable
Bit Manipulation
Easy
137. Single Number II Bit Manipulation Medium
138. Copy List with Random Pointer LinkedList
HashTable
Medium
139. Word Break Dynamic Programming Medium
140. Word Break II Dynamic Programming
Backtracking
Hard
141. Linked List Cycle LinkedList
Two Pointers
Easy
142. Linked List Cycle II LinkedList
Two Pointers
Medium
143. Reorder List LinkedList Medium
144. Binary Tree Preorder Traversal Stack
Tree
Medium
145. Binary Tree Postorder Traversal Tree
Stack
Medium
147. Insertion Sort List Sort
LinkedList
Medium
148. Sort List Sort
LinkedList
Medium
150. Evaluate Reverse Polish Notation Stack Medium
151. Reverse Words in a String String Medium
152. Maximum Product Subarray 🚨🚨 Array
Dynamic Programming
Medium
153. Find Minimum in Rotated Sorted Array Array
BinarySearch
Medium
154. Find Minimum in Rotated Sorted Array II Array
BinarySearch
Hard
155. Min Stack Stack
Design
Easy
162. Find Peak Element Array
BinarySearch
Medium
165. Compare Version Numbers String Medium
167. Two Sum II - Input array is sorted Array
Two pointers
Binary Search
Easy
169. Majority Element Array
Divide and Conquer
Bit Manipulation
Easy
171. Excel Sheet Column Number Math Easy
173. Binary Search Tree Iterator Tree
Stack
Design
Medium
174. Dungeon Game Dynamic Programming
Binary Search
Hard
179. Largest Number Sort Medium
187. Repeated DNA Sequences HashTable
Bit Manipulation
Medium
188. Best Time to Buy and Sell Stock IV Dynamic Programming Hard
189. Rotate Array Array Easy
190. Reverse Bits Bit Manipulation Easy
191. Number of 1 Bits Bit Manipulation Easy
198. House Robber Dynamic Programming Easy
201. Bitwise AND of Numbers Range Bit Manipulation Medium
203. Remove Linked List Elements LinkedList Easy
204. Count Primes Math
HashTable
Easy
206. Reverse Linked List LinkedList Easy
207. Course Schedule DFS
BFS
Graph
Topological Sort
Medium
208. Implement Trie (Prefix Tree) Trie
Design
Medium
209. Minimum Size Subarray Sum Array
Two Pointer
Binary Search
Medium
210. Course Schedule II DFS
BFS
Graph
Topological Sort
Medium
211. Add and Search Word - Data structure design Backtacking
Design
Trie
Medium
212. Word Search II Trie
Backtracking
Hard
213. House Robber II Dynamic Programming Medium
214. Shortest Palindrome 🚨🚨🚨 String Hard
215. Kth Largest Element in an Array 🚨 Divide and Conquer
Heap
Medium
216. Combination Sum III Array
Backtracking
Medium
217. Contains Duplicate Array
HashTable
Easy
220. Contains Duplicate III Sort
Ordered Map
Medium
221. Maximal Square Dynamic Programming Medium
222. Count Complete Tree Nodes Tree
Binary Search
Medium
226. Invert Binary Tree Tree Easy
227. Basic Calculator II String
Stack
Medium
228. Summary Ranges Array Easy
229. Majority Element II 🚨 Array Medium
230. Kth Smallest Element in a BST Binary Search
Tree
Medium
231. Power of Two Math
Bit Manipulation
Easy
232. Implement Queue using Stacks Stack
Design
Easy
234. Palindrome Linked List LinkedList
Two Pointers
Easy
235. Lowest Common Ancestor of a Binary Search Tree Tree Easy
236. Lowest Common Ancestor of a Binary Tree Tree Medium
237. Delete Node in a Linked List LinkedList Easy
238. Product of Array Except Self Array Medium
240. Search a 2D Matrix II 🚨 BinarySearch
Divide and Conquer
Medium
242. Valid Anagram HsahTable
Sort
Easy
257. Binary Tree Paths Tree
DFS
Easy
258. Add Digits Math Easy
260. Single Number III Bit Manipulation Medium
263. Ugly Number Math Easy
264. Ugly Number II Math
Dynamic Programming
Heap
Medium
268. Missing Number Array
Math
Bit Manipulation
Easy
274. H-Index Sort
HashTable
Medium
275. H-Index II Binary Search Medium
279. Perfect Squares 🚨 Dynamic Programming
BFS
Math
Medium
283. Move Zeroes Array
Two pointers
Easy
287. Find the Duplicate Number Array
Two pointers
Binary Search
Medium
289. Game of Life Array Medium
290. Word Pattern HashTable Easy
292. Nim Game Brainteaser
Minimax
Easy
297. Serialize and Deserialize Binary Tree Tree
Design
Hard
299. Bulls and Cows HashTable Medium
300. Longest Increasing Subsequence Binary Search
Dynamic Programming
Medium
303. Range Sum Query - Immutable Dynamic Programming Easy
307. Range Sum Query - Mutable Binary Indexed Tree
Segment Tree
Medium
309. Best Time to Buy and Sell Stock with Cooldown 🚨 Dynamic Programming Medium
310. Minimum Height Trees BFS
Graph
Medium
312. Burst Balloons 🚨 Divide and Conquer
Dynamic Programming
Hard
315. Count of Smaller Numbers After Self Binary Search
Binary Indexed Tree
Divide and Conquer
Sort
Segment Tree
Hard
316. Remove Duplicate Letters String
Stack
Greedy
Medium
319. Bulb Switcher Math
Brainteaser
Medium
322. Coin Change 🚨 Dynamic Programming Medium
328. Odd Even Linked List LinkedList Medium
329. Longest Increasing Path in a Matrix DFS
TopologicalSort
Memoization
Hard
330. Patching Array 🚨🚨🚨 Greedy Hard
332. Reconstruct Itinerary 🚨 DFS
Graph
Medium
336. Palindrome Pairs 🚨🚨🚨 HashTable
String
Trie
Hard
337. House Robber III Tree
DFS
Medium
338. Counting Bits Dynamic Programming
Bit Manipulation
Medium
341. Flatten Nested List Iterator Stack
Design
Medium
342. Power of Four Bit Manipulation Easy
343. Integer Break Math
Dynamic Programming
Medium
344. Reverse String String
Two Pointers
Easy
347. Top K Frequent Elements HashTable
Heap
Medium
349. Intersection of Two Arrays Binary Search
Two Pointers
HashTable
Sort
Easy
350. Intersection of Two Arrays II HashTable
Two Pointers
BinarySearch
Sort
Easy
368. Largest Divisible Subset Dynamic Programming
Math
Medium
376. Wiggle Subsequence Dynamic Programming
Greedy
Medium
378. Kth Smallest Element in a Sorted Matrix Binary Search
Heap
Medium
382. Linked List Random Node Reservoir Sampling Medium
387. First Unique Character in a String HashTable
String
Easy
389. Find the Difference HashTable
Bit Manipulation
Easy
392. Is Subsequence Binary Search
Dynamic Programming
Greedy
Easy
394. Decode String DFS
Stack
Medium
399. Evaluate Division 🚨 UnionFind
Graph
Medium
400. Nth Digit Math Medium
402. Remove K Digits Stack
Greedy
Medium
404. Sum of Left Leaves Tree Easy
406. Queue Reconstruction by Height Greedy Medium
409. Longest Palindrome HashTable Easy
410. Split Array Largest Sum Binary Search
Dynamic Programming
Hard
412. Fizz Buzz other Easy
415. Add Strings String Easy
421. Maximum XOR of Two Numbers in an Array 🚨 Bit Manipulation
Trie
Medium
424. Longest Repeating Character Replacement 🚨 Two Pointers
Sliding Windows
Medium
429. N-ary Tree Level Order Traversal BFS
Tree
Medium
430. Flatten a Multilevel Doubly Linked List LinkedList
DFS
Medium
435. Non-overlapping Intervals 🚨 Greedy Medium
436. Find Right Interval Binary Search Medium
437. Path Sum III Tree Medium
441. Arranging Coins Math
BinarySearch
Easy
442. Find All Duplicates in an Array Array Medium
445. Add Two Numbers II LinkedList Medium
448. Find All Numbers Disappeared in an Array Array Easy
450. Delete Node in a BST Tree Medium
452. Minimum Number of Arrows to Burst Balloons Greedy
Sort
Medium
454. 4Sum II HashTable
BinarySearch
Medium
456. 132 Pattern 🚨 Stack Medium
459. Repeated Substring Pattern String Easy
460. LFU Cache Design Hard
461. Hamming Distance Bit Manipulation Easy
463. Island Perimeter HashTable Easy
468. Validate IP Address String Medium
470. Implement Rand10() Using Rand7() Random
Rejection Sampling
Medium
480. Sliding Window Median Sliding Window Hard
481. Magical String other Medium
485. Max Consecutive Ones Array Easy
486. Predict the Winner 🚨 Dynamic Programming
MiniMax
Medium
491. Increasing Subsequences 🚨 DFS Medium
494. Target Sum 🚨 Dynamic Programming
DFS
Medium
495. Teemo Attacking Array Medium
496. Next Greater Element I Stack Easy
497. Random Point in Non-overlapping Rectangles Random
Binary Search
Medium
501. Find Mode in Binary Search Tree Tree Easy
503. Next Greater Element II Stack Medium
507. Perfect Number Math Easy
509. Fibonacci Number Array Easy
513. Find Bottom Left Tree Value DFS
BFS
Tree
Medium
515. Find Largest Value in Each Tree Row DFS
BFS
Tree
Medium
518. Coin Change 2 Dynamic Programming Medium
520. Detect Capital String Easy
521. Longest Uncommon Subsequence I String Easy
523. Continuous Subarray Sum 🚨 Math
Dynamic Programming
Medium
524. Longest Word in Dictionary through Deleting Two Pointers
Sort
Medium
525. Contiguous Array 🚨 HashTable Medium
528. Random Pick with Weight 🚨 Random
BinarySerach
Medium
529. Minesweeper DFS
BFS
Medium
530. Minimum Absolute Difference in BST Tree Easy
535. Encode and Decode TinyURL Math
HashTable
Medium
537. Complex Number Multiplication Math
String
Medium
538. Convert BST to Greater Tree Tree Medium
539. Minimum Time Difference String Medium
543. Diameter of Binary Tree Tree Easy
546. Remove Boxes 🚨🚨🚨 Dynamic Programming
DFS
Hard
547. Friend Circles DFS
UnionFind
Medium
556. Next Greater Element III String Medium
557. Reverse Words in a String III String Easy
559. Maximum Depth of N-ary Tree DFS
BFS
Tree
Easy
561. Array Partition I Array Easy
563. Binary Tree Tilt Tree
DFS
Recursion
Easy
565. Array Nesting Array Medium
566. Reshape the Matrix Array Easy
572. Subtree of Another Tree Tree Easy
581. Shortest Unsorted Continuous Subarray Array Easy
589. N-ary Tree Preorder Traversal Tree Easy
593. Valid Square Math Medium
594. Longest Harmonious Subsequence HashTable Easy
595. Big Countries Database Easy
617. Merge Two Binary Trees Tree Easy
621. Task Scheduler Array
Greedy
Queue
Medium
627. Swap Salary Datebase Easy
628. Maximum Product of Three Numbers Array
Math
Easy
630. Course Schedule III Greedy Hard
637. Average of Levels in Binary Tree Tree Easy
643. Maximum Average Subarray I Array Easy
645. Set Mismatch Math
HashTable
Easy
646. Maximum Length of Pair Chain Dynamic Programming Medium
647. Palindromic Substrings String
Dynamic Programming
Medium
649. Dota2 Senate Greedy Medium
654.Maximum Binary Tree Tree Medium
657. Robot Return to Origin String Easy
661. Image Smoother Array Easy
662. Maximum Width of Binary Tree Tree Medium
667. Beautiful Arrangement II Array Medium
669. Trim a Binary Search Tree Tree
Recursion
Medium
671. Second Minimum Node In a Binary Tree Tree
DFS
Binary Tree
Easy
673. Number of Longest Increasing Subsequence 🚨 Dynamic Programming Medium
674. Longest Continuous Increasing Subsequence Array Easy
679. 24 Game 🚨 DFS Hard
680. Valid Palindrome II String Easy
684. Redundant Connection Tree
Union Find
Graph
Medium
685. Redundant Connection II Tree
Union Find
Graph
DFS
Hard
692. Top K Frequent Words HashTable
Heap
Trie
Medium
695. Max Area of Island Array
DFS
Medium
696. Count Binary Substrings String Easy
697. Degree of an Array Array Easy
700. Search in a Binary Search Tree Tree Easy
701. Insert into a Binary Search Tree Tree Medium
704. Binary Search Binary Search Easy
705. Design HashSet HashTable
Design
Easy
709.To Lower Case String Easy
713. Subarray Product Less Than K Array
Two Pointers
Medium
714. Best Time to Buy and Sell Stock with Transaction Fee Array
Dynamic Programming
Greedy
Medium
717. 1-bit and 2-bit Characters Array Easy
718. Maximum Length of Repeated Subarray Array
BinarySearch
HashTable
Dynamic Programming
Medium
720. Longest Word in Dictionary HashTable
Trie
Easy
721. Accounts Merge DFS
UnionFind
Medium
724. Find Pivot Index Array Easy
725. Split Linked List in Parts LinkedList Medium
726. Number of Atoms HashTable
Stack
Recursion
Hard
728. Self Dividing Numbers Math Easy
733. Flood Fill DFS Easy
735. Asteroid Collision Stack Medium
738. Monotone Increasing Digits Greedy Medium
739. Daily Temperatures Stack
HashTable
Medium
741. Cherry Pickup 🚨🚨🚨 Dynamic Programming Hard
746. Min Cost Climbing Stairs Array
Dynamic Programming
Easy
754. Reach a Number 🚨 Math Medium
763. Partition Labels Greedy
Two Pointers
Medium
766. Toeplitz Matrix Array Easy
767. Reorganize String String
Heap
Greedy
Sort
Medium
768. Max Chunks To Make Sorted II Array Hard
769. Max Chunks To Make Sorted Array Medium
771. Jewels and Stones HashTable Easy
778. Swim in Rising Water 🚨 BinarySearch
Heap
DFS
UnionFind
Hard
783. Minimum Distance Between BST Nodes Tree
Recursive
Easy
785. Is Graph Bipartite? DFS
BFS
Graph
Medium
787. Cheapest Flights Within K Stops 🚨 Dynamic Programming
DFS
Heap
Medium
791. Custom Sort String String Medium
797. Al Paths From Source to Target DFS Medium
799. Champagne Tower other Medium
804. Unique Morse Code Words String Easy
807. Max Increase to Keep City Skyline other Medium
814. Binary Tree Pruning Tree Medium
817. Linked List Components LinkedList Medium
818. Race Car 🚨🚨🚨 Dynamic Programming
Heap
Hard
824. Goat Latin String Easy
830. Positions of Large Groups Array Easy
832. Flipping an Image Array Easy
835. Image Overlap 🚨 Array Medium
837. New 21 Game 🚨 Dynamic Programming Medium
841. Keys and Rooms DFS
Graph
Medium
842. Split Array into Fibonacci Sequence Backtracking
Greedy
String
Medium
844. Backspace String Compare Two Pointers
Stack
Easy
845. Longest Mountain in Array Two Pointers Medium
849. Maximize Distance to Closest Person Array Medium
852. Peak Index in a Mountain Array Binary Search Easy
856. Score of Parentheses Array
Stack
Medium
858. Mirror Reflection Math Medium
859. Buddy Strings String Easy
860. Lemonade Change Greedy Easy
861. Score After Flipping Matrix Greedy Medium
862. Shortest Subarray with Sum at Least K 🚨 Queue
Binary Search
Hard
863. All Nodes Distance K in Binary Tree Tree
DFS
BFS
Medium
867. Transpose Matrix Array Easy
869. Reordered Power of 2 Math Medium
872. Leaf-Similar Trees DFS
Tree
Easy
875. Koko Eating Bananas BinarySearch Medium
876. Middle of the Linked List LinkedList Easy
877. Stone Game Dynamic Programming
MiniMax
Math
Medium
881. Boats to Save People Greedy
Two Pointers
Medium
888. Fair Candy Swap Array Easy
889. Construct Binary Tree from Preorder and Postorder Traversal Tree Medium
890. Find and Replace Pattern String Medium
894. All Possible Full Binary Trees🚨 Tree
Recursion
Medium
897. Increasing Order Search Tree DFS
Tree
Easy
902. Numbers At Most N Given Digit Set 🚨 Math
Dynamic Programming
Hard
904. Fruit Into Baskets Two Pointers Medium
905. Sort Array By Parity Array Easy
912. Sort an Array Sort Medium
922. Sort Array By Parity II Array
Sort
Easy
923. 3Sum With Multiplicity 🚨 Two Pointer Medium
925. Long Pressed Name String
Two Pointer
Easy
929. Unique Email Addresses String Easy
930. Binary Subarrays With Sum Two Pointers
HashTable
Medium
933. Number of Recent Calls Queue Easy
938. Range Sum of BST Tree
Recursion
Easy
941. Valid Mountain Array Array Easy
942. DI String Match Math Easy
943. Find the Shortest Superstring Dynamic Programming Hard
948. Bag of Tokens Greedy Medium
949. Largest Time for Given Digits Math Medium
950. Reveal Cards In Increasing Order Array Medium
952. Largest Component Size by Common Factor Math
Union Find
Hard
957. Prison Cells After N Days HashTable Medium
959. Regions Cut By Slashes DFS
Graph
Union Find
Medium
961. N-Repeated Element in Size 2N Array HashTable Easy
965. Univalued Binary Tree Tree Easy
966. Vowel Spellchecker HashTable
String
Medium
967. Numbers With Same Consecutive Differences Dynamic Programming Medium
969. Pancake Sorting Array
Sort
Medium
973. K Closest Points to Origin Divide and Conquer
Heap
Sort
Medium
974. Subarray Sums Divisible by K 🚨 Array
HashTable
Medium
976. Largest Perimeter Triangle Sort
Math
Easy
977.Squares of a Sorted Array Array
TwoPointers
Easy
978. Longest Turbulent Subarray Array
Dynamic Programming
Silding Window
Medium
979. Distribute Coins in Binary Tree DFS
Tree
Medium
980. Unique Paths III DFS
BackTracking
Hard
983. Minimum Cost For Tickets 🚨 Dynamic Programming Medium
987. Vertical Order Traversal of a Binary Tree Tree
HashTable
Medium
989. Add to Array-Form of Integer Array Easy
990. Satisfiability of Equality Equations Union Find
Graph
Medium
992. Subarrays with K Different Integers Two Pointers
HashTable
Sliding Window
Hard
994. Rotting Oranges BFS Medium
1000. Minimum Cost to Merge Stones 🚨 Dynamic Programming Hard
1002. Find Common Characters Array
HashTable
Easy
1004. Max Consecutive Ones III Two Pointers
Sliding Window
Medium
1005. Maximize Sum Of Array After K Negations Greedy Easy
1007. Minimum Domino Rotations For Equal Row Array
Greedy
Medium
1008. Construct Binary Search Tree from Preorder Traversal Tree Medium
1011. Capacity To Ship Packages Within D Days Array
Binary Search
Medium
1013. Partition Array Into Three Parts With Equal Sum Array Easy
1014. Best Sightseeing Pair 🚨 Array Medium
1015. Smallest Integer Divisible by K Math Medium
1018. Binary Prefix Divisible By 5 Array Easy
1019. Next Greater Node In Linked List 🚨 LinkedList
Stack
Medium
1021. Remove Outermost Parentheses Stack Easy
1022. Sum of Root To Leaf Binary Numbers Tree Easy
1024. Video Stitching Dynamic Programming Medium
1025. Divisor Game Math
Dynamic Programming
Easy
1026. Maximum Difference Between Node and Ancestor DFS
Tree
Medium
1028. Recover a Tree From Preorder Traversal DFS
Tree
Hard
1029. Two City Scheduling Greedy Medium
1030. Matrix Cells in Distance Order Sort Easy
1032. Stream of Characters Trie Hard
1038. Binary Search Tree to Greater Sum Tree Binary Search Tree Medium
1039. Minimum Score Triangulation of Polygon 🚨 Dynamic Programming Medium
1041. Robot Bounded In Circle Math Medium
1044. Longest Duplicate Substring 🚨🚨🚨 Binary Search
HashTable
Hard
1046. Last Stone Weight Heap
Greedy
Easy
1047. Remove All Adjacent Duplicates In String Stack Easy
1051. Height Checker Array Easy
1053. Previous Permutation With One Swap Array
Greedy
Medium
1079. Letter Tile Possibilities 🚨 BackTracking Medium
1081. Smallest Subsequence of Distinct Characters String
Stack
Greedy
Medium
1094. Car Pooling Greedy Medium
1095. Find in Mountain Array Binary Search Hard
1103. Distribute Candies to People Math Easy
1108.Defanging an IP Address String Easy
1109. Corporate Flight Bookings 🚨 Math
Array
Medium
1110. Delete Nodes And Return Forest DFS
Tree
Medium
1115. Print FooBar Alternately Concurrency Medium
1122. Relative Sort Array Array
Sort
Easy
1128. Number of Equivalent Domino Pairs Array Easy
1130. Minimum Cost Tree From Leaf Values Tree
Stack
Dynamic Programming
Medium
1137. N-th Tribonacci Number Recursive Easy
1140. Stone Game II 🚨 Dynamic Programming Medium
1143. Longest Common Subsequence Dynamic Programming Medium
1155. Number of Dice Rolls With Target Sum Dynamic Programming Medium
1179. Reformat Department Table🚨 Datebase Easy
1202. Smallest String With Swaps Array
UnionFind
Medium
1207. Unique Number of Occurrences HashTable Easy
1208. Get Equal Substrings Within Budget Array
Sliding Window
Medium
1217. Minimum Cost to Move Chips to The Same Position Math
Array
Greedy
Easy
1221. Split a String in Balanced Strings String Easy
1234. Replace the Substring for Balanced String String
Two Pointers
Medium
1248. Count Number of Nice Subarrays Two Pointers Medium
1249. Minimum Remove to Make Valid Parentheses String
Stack
Medium
1252. Cells with Odd Values in a Matrix Array Easy
1261. Find Elements in a Contaminated Binary Tree HashTable
Tree
Medium
1266. Minimum Time Visiting All Points Array
Geometry
Easy
1281. Subtract the Product and Sum of Digits of an Integer Math Easy
1282. Group the People Given the Group Size They Belong To🚨 Greedy Medium
1283. Find the Smallest Divisor Given a Threshold Binary Search Medium
1286. Iterator for Combination Design
Backtracking
Medium
1290.Convert Binary Number in a Linked List to Integer LinkedList
Bit Manipulation
Easy
1291. Sequential Digits Backtracking Medium
1300. Sum of Mutated Array Closest to Target Array
BinarySearch
Medium
1302. Deepest Leaves Sum DFS
Tree
Medium
1305. All Elements in Two Binary Search Trees Sort
Tree
Medium
1314. Matrix Block Sum Dynamic Programming Medium
1315. Sum of Nodes with Even-Valued Grandparent DFS
Tree
Medium
1319. Number of Operations to Make Network Connected DFS
BFS
UnionFind
Medium
1329. Sort the Matrix Diagonally Array
Sort
Medium
1340. Jump Game V 🚨 Dynamic Programming Hard
1344. Angle Between Hands of a Clock Math Medium
1356. Sort Integers by The Number of 1 Bits Sort
Bit Manipulation
Easy
1358. Number of Substrings Containing All Three Characters String Medium
1365. How Many Numbers Are Smaller Than the Current Number Array
HashTable
Easy
1370. Increasing Decreasing String String
Sort
Easy
1406. Stone Game III 🚨 Dynamic Programming Hard
1419. Minimum Number of Frogs Croaking String Medium
1425. Constrained Subsequence Sum Dynamic Programming Hard
1431. Kids With the Greatest Number of Candies Array Easy
1437. Check If All 1's Are at Least Length K Places Away Array Easy
1446. Consecutive Characters String Easy
1450. Number of Students Doing Homework at a Given Time Array Easy
1451. Rearrange Words in a Sentence String
Sort
Medium
1452. People Whose List of Favorite Companies Is Not a Subset of Another List String
Sort
Medium
1455. Check If a Word Occurs As a Prefix of Any Word in a Sentence String Easy
1456. Maximum Number of Vowels in a Substring of Given Length String
Sliding Window
Medium
1457. Pseudo-Palindromic Paths in a Binary Tree DFS
Tree
Bit Manipulation
Medium
1458. Max Dot Product of Two Subsequences 🚨 Dynamic Programming Hard
1462. Course Schedule IV Graph
TopologicalSort
Medium
1464. Maximum Product of Two Elements in an Array Array Easy
1465. Maximum Area of a Piece of Cake After Horizontal and Vertical Cuts DFS
Tree
Medium
1466. Reorder Routes to Make All Paths Lead to the City Zero DFS
Tree
Medium
1470. Shuffle the Array Array Easy
1471. The k Strongest Values in an Array Array
Sort
Medium
1472. Design Browser History Design Medium
1473. Paint House III 🚨 Dynamic Programming Hard
1480. Running Sum of 1d Array Array Easy
1481. Least Number of Unique Integers after K Removals Array
Sort
Medium
1482. Minimum Number of Days to Make m Bouquets 🚨🚨🚨 Binary Search
Array
Medium
1483. Kth Ancestor of a Tree Node 🚨🚨 Dynamic Programming Hard
1486. XOR Operation in an Array Array
Bit Manipulation
Easy
1487. Making File Names Unique String
HashTable
Medium
1488. Avoid Flood in The City Array
HashTable
Medium
1489. Find Critical and Pseudo-Critical Edges in Minimum Spanning Tree 🚨 DFS
UnionFind
Hard
1491. Average Salary Excluding the Minimum and Maximum Salary Array
Sort
Easy
1492. The kth Factor of n Math Medium
1493. Longest Subarray of 1's After Deleting One Element Array Medium
1496. Path Crossing String Easy
1497. Check If Array Pairs Are Divisible by k Array
Math
Greedy
Medium
1498. Number of Subsequences That Satisfy the Given Sum Condition 🚨 Sort
Sliding Window
Medium
1499. Max Value of Equation 🚨 Array
Sliding Window
Hard
1502. Can Make Arithmetic Progression From Sequence Array
Sort
Easy
1503. Last Moment Before All Ants Fall Out of a Plank Array
Brainteaser
Medium
1504. Count Submatrices With All Ones Dynamic Programming Medium
1505. Minimum Possible Integer After at Most K Adjacent Swaps On Digits 🚨 Greedy Hard
1507. Reformat Date String Easy
1508. Range Sum of Sorted Subarray Sums Array
Sort
Medium
1509. Minimum Difference Between Largest and Smallest Value in Three Moves Array
Sort
Medium
1510. Stone Game IV Dynamic Programming Hard
1512. Number of Good Pairs Array
Math
HashTable
Easy
1513. Number of Substrings With Only 1s String
Math
Medium
1514. Path with Maximum Probability 🚨🚨🚨 Graph Medium
1515. Best Position for a Service Centre 🚨🚨 Geometry Hard
1518. Water Bottles Greedy Easy
1519. Number of Nodes in the Sub-Tree With the Same Label BFS
DFS
Medium
1520. Maximum Number of Non-Overlapping Substrings 🚨🚨 Greedy Hard
1521. Find a Value of a Mysterious Function Closest to Target 🚨🚨🚨 BinarySearch
Segment Tree
Bit Manipulation
Hard
1523. Count Odd Numbers in an Interval Range Math Easy
1524. Number of Sub-arrays With Odd Sum 🚨 Array
Math
Medium
1525. Number of Good Ways to Split a String String
Bit Manipulation
Medium
1526. Minimum Number of Increments on Subarrays to Form a Target Array 🚨 Segment Tree Hard
1528. Shuffle String Sort Easy
1529. Bulb Switcher IV String Medium
1530. Number of Good Leaf Nodes Pairs Tree
DFS
Medium
1531. String Compression II 🚨🚨🚨 String
Dynamic Programming
Hard
1534. Count Good Triplets Array Easy
1535. Find the Winner of an Array Game Array Medium
1536. Minimum Swaps to Arrange a Binary Grid Greedy Medium
1537. Get the Maximum Score Dynamic Programming Hard
1539. Kth Missing Positive Number Array
HashTable
Easy
1540. Can Convert String in K Moves String
Greedy
Medium
1541. Minimum Insertions to Balance a Parentheses String String
Stack
Medium
1542. Find Longest Awesome Substring 🚨🚨🚨 String
Bit Manipulation
Hard
1544. Make The String Great String
Stack
Easy
1545. Find Kth Bit in Nth Binary String String Medium
1546. Maximum Number of Non-Overlapping Subarrays With Sum Equals Target 🚨🚨 Dynamic Programming Medium
1547. Minimum Cost to Cut a Stick 🚨🚨🚨 Dynamic Programming Hard
1550. Three Consecutive Odds Array Easy
1551. Minimum Operations to Make Array Equal Math Medium
1552. Magnetic Force Between Two Balls Array
Binary Search
Medium
1553. Minimum Number of Days to Eat N Oranges Dynamic Programming Hard
1556. Thousand Separator String Easy
1557. Minimum Number of Vertices to Reach All Nodes Grpah Medium
1558. Minimum Numbers of Function Calls to Make Target Array Greedy Medium
1559. Detect Cycles in 2D Grid DFS Hard
1560. Most Visited Sector in a Circular Track Array Easy
1561. Maximum Number of Coins You Can Get Sort Medium
1562. Find Latest Group of Size M 🚨 Binary Search Medium
1563. Stone Game V 🚨🚨🚨 Dynamic Programming Hard
1566. Detect Pattern of Length M Repeated K or More Times Array Easy
1567. Maximum Length of Subarray With Positive Product Greedy Meidum
1568. Minimum Number of Days to Disconnect Island Greedy Hard
1569. Number of Ways to Reorder Array to Get Same BST 🚨🚨 Dynamic Programming Hard
1572. Matrix Diagonal Sum Array Easy
1573. Number of Ways to Split a String String Medium
1574. Shortest Subarray to be Removed to Make Array Sorted Array
Binary Search
Medium
1575. Count All Possible Routes 🚨🚨🚨 Dynamic Programming Hard
1576. Replace All ?'s to Avoid Consecutive Repeating Characters String Easy
1577. Number of Ways Where Square of Number Is Equal to Product of Two Numbers HashTable
Math
Medium
1578. Minimum Deletion Cost to Avoid Repeating Letters Greedy Medium
1579. Remove Max Number of Edges to Keep Graph Fully Traversable 🚨🚨🚨 Union Find Hard
1582. Special Positions in a Binary Matrix Array Easy
1583. Count Unhappy Friends Array Medium
1584. Min Cost to Connect All Points Union Find Medium
1585. Check If String Is Transformable With Substring Sort Operations String
Greedy
Hard
1588. Sum of All Odd Length Subarrays Array Easy
1589. Maximum Sum Obtained of Any Permutation Greedy Medium
1590. Make Sum Divisible by P 🚨 Array
Binary Search
Medium
1591. Strange Printer II 🚨🚨 Greedy Hard
1592. Rearrange Spaces Between Words String Easy
1593. Split a String Into the Max Number of Unique Substrings Backtracking Medium
1594. Maximum Non Negative Product in a Matrix Dynamic Programming
Greedy
Medium
1595. Minimum Cost to Connect Two Groups of Points 🚨🚨 Dynamic Programming
Graph
Hard
1598. Crawler Log Folder Stack Easy
1599. Maximum Profit of Operating a Centennial Wheel Greedy Medium
1600. Throne Inheritance Tree
Design
Medium
1601. Maximum Number of Achievable Transfer Requests 🚨🚨 Dynamic Programming Hard
1603. Design Parking System Design Easy
1604. Alert Using Same Key-Card Three or More Times in a One Hour Period String
Ordered Map
Medium
1605. Find Valid Matrix Given Row and Column Sums Greedy 🚨 Medium
1606. Find Servers That Handled Most Number of Requests 🚨🚨 Ordered Map Hard
1608. Special Array With X Elements Greater Than or Equal X Array Easy
1609. Even Odd Tree Tree Medium
1610. Maximum Number of Visible Points Two Pointers
Geometry
Hard
1611. Minimum One Bit Operations to Make Integers Zero 🚨🚨 DynamicProgramming
Bit Manipulation
Hard
1614. Maximum Nesting Depth of the Parentheses String Easy
1615. Maximal Network Rank Graph Medium
1616. Split Two Strings to Make Palindrome 🚨 String
Two Pointers
Greedy
Medium
1617. Count Subtrees With Max Distance Between Cities 🚨🚨 Backtracking Hard
1636. Sort Array by Increasing Frequency Sort
Array
Easy
1637. Widest Vertical Area Between Two Points Containing No Points Sort Medium
1638. Count Substrings That Differ by One Character String
Rolling Hash
Trie
HashTable
Medium
1639. Number of Ways to Form a Target String Given a Dictionary Dynamic Programming Hard
1646. Get Maximum in Generated Array Array Easy
1647. Minimum Deletions to Make Character Frequencies Unique Greedy
Sort
Medium
1648. Sell Diminishing-Valued Colored Balls Greedy
Sort
Math
Medium
1649. Create Sorted Array through Instructions Binary Indexed Tree
Segment Tree
Ordered Map
Hard
1657. Determine if Two Strings Are Close Medium Medium
1662. Check If Two String Arrays are Equivalent String Easy
1663. Smallest String With A Given Numeric Value Greedy Medium
1664. Ways to Make a Fair Array Greedy
Dynamic Programming
Medium
1665. Minimum Initial Energy to Finish Tasks Greedy Hard
1668. Maximum Repeating Substring String Easy
1669. Merge In Between Linked Lists LinkedList Medium
1670. Design Front Middle Back Queue LinkedList
Design
Dequeue
Medium
1671. Minimum Number of Removals to Make Mountain Array Dynamic Programming Hard
1678. Goal Parser Interpretation String Easy
1679. Max Number of K-Sum Pairs HashTable Medium
1680. Concatenation of Consecutive Binary Numbers Math Medium
1689. Partitioning Into Minimum Number Of Deci-Binary Numbers Greedy Medium
1704. Determine if String Halves Are Alike String Easy
1710. Maximum Units on a Truck Sort
Greedy
Array
Easy
1720. Decode XORed Array Bit Manipulation Easy
1734. Decode XORed Permutation Bit Manipulation Medium
1790. Check if One String Swap Can Make Strings Equal String Easy
1791. Find Center of Star Graph Graph Mediun
1792. Maximum Average Pass Ratio Heap Mediun
1793. Maximum Score of a Good Subarray Greedy Hard
1796. Second Largest Digit in a String String Easy
1797. Design Authentication Manager Design
HashTable
Medium
1798. Maximum Number of Consecutive Values You Can Make Greedy Medium
1799. Maximize Score After N Operations 🚨🚨 Dynamic Programming
Backtracking
Recursion
Hard
1800. Maximum Ascending Subarray Sum Two Pointers Easy
1838. Frequency of the Most Frequent Element Array
Binary Search
Greedy
Sliding Window
Sorting
Prefix Sum
Medium
2351. First Letter to Appear Twice String
HashTable
Counting
Easy
2352. Equal Row and Column Pairs Array
HashTable
Matrix
Simulation
Medium