Skip to content
Eve
2040 Kth Smallest Product of Two Sorted Arrays
Initializing search
Everoot
Home
Algorithms
Architecture
Database
OS
Network
Tools
Projects
Blog
Eve
Everoot
Home
Algorithms
Algorithms
Data Structures
Data Structures
Array
CS61B
Leetcode
Leetcode
LeetCode Tags
Problem List
Problem List
130. Surrounded Regions
681. Next Closest Time
1 Longest Ascending Subsequence (Lai)
1. Two Sum
10 Quick Sort (Lai)
10. Regular Expression Matching
100. Same Tree
101. Symmetric Tree
102 Binary Tree Level Order Traversal
102 Largest Rectangle Of 1s (Lai)
102. Binary Tree Level Order Traversal
1026 Maximum Difference Between Node and Ancestor
103 Binary Tree Zigzag Level Order Traversal
103 Longest Consecutive 1s (Lai)
104. Maximum Depth of Binary Tree
1041. Robot Bounded In Circle
✅ 1046. Last Stone Weight
1047 Remove All Adjacent Duplicates In String
105 Largest X Of 1s (Lai)
105. Construct Binary Tree from Preorder and Inorder Traversal
1059. All Paths from Source Lead to Destination
106 Construct Binary Tree from Inorder and Postorder Traversal
106 Largest SubMatrix Sum (Lai)
1062. Longest Repeating Substring
1086. High Five
1091. Shortest Path in Binary Matrix
1099 Two Sum Less Than K
11. Container With Most Water
110. Balanced Binary Tree
1100 Find K-Length Substrings With No Repeated Characters
1101. The Earliest Moment When Everyone Become Friends
111 Minimum Depth of Binary Tree
112 Path Sum
1123. Lowest Common Ancestor of Deepest Leaves
113 Path Sum II
1139 Largest 1-Bordered Square
114 Flatten Binary Tree to Linked List
1143. Longest Common Subsequence
115. Distinct Subsequences
1150. Check If a Number Is Majority Element in a Sorted Array
116. Populating Next Right Pointers in Each Node
1168. Optimize Water Distribution in a Village
117 Array Deduplication III
118 Array Deduplication IV (Lai)
1185. Day of the Week
119 Largest And Smallest (Lai)
12. Integer to Roman
120 Largest And Second Largest (Lai)
1202. Smallest String With Swaps
121. Best Time to Buy and Sell Stock
1216. Valid Palindrome III
124. Binary Tree Maximum Path Sum
125 Rotate Matrix (Lai)
125. Valid Palindrome
1254. Number of Closed Islands
126 Lowest Common Ancestor I (Lai)
126 Word Ladder II
127 Lowest Common Ancestor II (Lai)
127. Word Ladder
128 Lowest Common Ancestor III (Lai)
128. Longest Consecutive Sequence
1287. Element Appearing More Than 25% In Sorted Array
129 Lowest Common Ancestor IV (Lai)
129 Sum Root to Leaf Numbers
1307 Verbal Arithmetic Puzzle
131 Deep Copy Linked List With Random Pointer (Lai)
131. Palindrome Partitioning131. Palindrome Partitioning
132 Deep Copy Undirected Graph (Lai)
132 Palindrome Partitioning II
133 Merge K Sorted Array (Lai)
133. Clone Graph
1331. Rank Transform of an Array
134 Merge K Sorted Lists (Lai)
134. Gas Station
135 Closest Number In Binary Search Tree (Lai)
135. Candy
136 Largest Number Smaller In Binary Search Tree (Lai)
136. Single Number
137 Cutting Wood I (Lai)
137. Single Number II
138 Maximum Path Sum Binary Tree I (Lai)
138. Copy List with Random Pointer
139. Word Break
1396. Design Underground System
14 Classical Binary Search (Lai)
140 Maximum Path Sum Binary Tree III (Lai)
141 Binary Tree Path Sum To Target III (Lai)
141. Linked List Cycle
142. Linked List Cycle II
143 Minimum Cuts For Palindromes (Lai)
143 Minimum Cuts For Palindromes
143. Reorder List
144 Binary Tree Preorder Traversal (recursive)
144 Binary Tree Preorder Traversal (recursive)
144 Binary Tree Preorder Traversal
1448. Count Good Nodes in Binary Tree
145 Binary Tree Postorder Traversal (iterative)
145 Binary Tree Postorder Traversal (recursive)
145 Binary Tree Postorder Traversal
146. LRU Cache
148 Sort List
149 Max Points on a Line
15 First Occurrence (Lai)
15. 3Sum
150. Evaluate Reverse Polish Notation
151 Reverse Words in a String
1512. Number of Good Pairs
152. Maximum Product Subarray
1522. Diameter of N-Ary Tree
1528 Shuffle String
1528 Shuffle String
153. Find Minimum in Rotated Sorted Array
155. Min Stack
156 Binary Tree Upside Down
157. Read N Characters Given Read4
158. Read N Characters Given read4 II - Call Multiple Times
1584. Min Cost to Connect All Points
159. Longest Substring with At Most Two Distinct Characters
16 Last Occurrence (Lai)
16. 3Sum Closest
1603. Design Parking System
162. Find Peak Element
163. Missing Ranges
1631. Path With Minimum Effort
1644 Lowest Common Ancestor of a Binary Tree II
1644. Lowest Common Ancestor of a Binary Tree II
1650 Lowest Common Ancestor of a Binary Tree III
166. Fraction to Recurring Decimal
167. Two Sum II - Input Array Is Sorted
1676 Lowest Common Ancestor of a Binary Tree IV
1676. Lowest Common Ancestor of a Binary Tree IV
1679 Max Number of K-Sum Pairs
1684. Count the Number of Consistent Strings
169. Majority Element
17 Closest In Sorted Array
17. Letter Combinations of a Phone Number
170 Two Sum III - Data structure design
171 Common Elements In Three Sorted Array (Lai)
1711 Count Good Meals
175. Combine Two Tables
1750. Minimum Length of String After Deleting Similar Ends
1757. Recyclable and Low Fat Products
176 Longest Common Substring (Lai)
177 Longest Common Subsequence (Lai)
179 All Valid Permutations Of Parentheses II (Lai)
18. 4Sum
180 2 Sum (Lai)
181 2 Sum All Pair I (Lai)
181. Employees Earning More Than Their Managers
182 2 Sum All Pair II (Lai)
1823. Find the Winner of the Circular Game
1832. Check if the Sentence Is Pangram
184. Department Highest Salary
1851. Minimum Interval to Include Each Query
186 3 Sum (Lai)
188 4 Sum (Lai)
1899. Merge Triplets to Form Target Triplet
19. Remove Nth Node From End of List ✅
190. Reverse Bits
1903. Largest Odd Number in String
191 Largest Product Of Length (Lai)
191. Number of 1 Bits
1910 Remove All Occurrences of a Substring
1929. Concatenation of Array
193 Kth Smallest With Only 3, 5, 7 As Factors (Lai)
194 Kth Closest Point To <0,0,0> (Lai)
1957. Delete Characters to Make Fancy String
197 ReOrder Array (Lai)
1971. Find if Path Exists in Graph
198 Largest Rectangle In Histogram (Lai)
198. House Robber
199 Max Water Trapped I (Lai)
199. Binary Tree Right Side View
2. Add Two Numbers
20. Valid Parentheses
200 Max Water Trapped II (Lai)
200. Number of Islands
2006 Count Number of Pairs With Absolute Difference K
2013. Detect Squares
202 Kth Smallest In Two Sorted Arrays (Lai)
202. Happy Number
203 Remove Linked List Elements
2035 Partition Array Into Two Arrays to Minimize Sum Difference
204 Maximum Values Of Size K Sliding Windows (Lai)
2040 Kth Smallest Product of Two Sorted Arrays
205 Implement LRU Cache (Lai)
205. Isomorphic Strings
206. Reverse Linked List
207. Course Schedule
207. Course Schedule
208. Implement Trie (Prefix Tree)
209. Minimum Size Subarray Sum
21. Merge Two Sorted Lists ✅
210. Course Schedule II
211 Reconstruct Binary Search Tree With Postorder Traversal (Lai)
211. Design Add and Search Words Data Structure
212. Word Search II
213 Reconstruct Binary Tree With Preorder And Inorder (Lai)
213. House Robber II
2148. Count Elements With Strictly Smaller and Greater Elements
215 Reconstruct Binary Tree With Levelorder And Inorder (Lai)
215. Kth Largest Element in an Array
216 Most Points On A Line (Lai)
216. Combination Sum III
217 Largest Set Of Points With Positive Slope (Lai)
217. Contains Duplicate ✅
219 Contains Duplicate II
22. Generate Parentheses
221 Maximal Square
222. Count Complete Tree Nodes
2220. Minimum Bit Flips to Convert Number
224. Basic Calculator
226. Invert Binary Tree
227. Basic Calculator II
2271. Maximum White Tiles Covered by a Carpet
2275. Largest Combination With Bitwise AND Greater Than Zero
229 Majority Element II
23. Merge k Sorted Lists
230. Kth Smallest Element in a BST
2312 Selling Pieces of Wood
232 Implement Queue using Stacks
2330. Valid Palindrome IV
234 Palindrome Linked List
235. Lowest Common Ancestor of a Binary Search Tree
236. Lowest Common Ancestor of a Binary Tree
2375. Construct Smallest Number From DI String
238. Product of Array Except Self ✅
239. Sliding Window Maximum
24 Swap Nodes in Pairs
240 Search a 2D Matrix II
242. Valid Anagram ✅
246. Strobogrammatic Number
247. Strobogrammatic Number II
2485. Find the Pivot Integer
2490. Circular Sentence
25 K Smallest In Unsorted Array (Lai)
25. Reverse Nodes in k-Group
252. Meeting Rooms
253. Meeting Rooms II
254 Factor Combinations
2540. Minimum Common Value
255 Implement Stack using Queues
258 Move 0s To The End I (Lai)
258 Move 0s To The End I (Lai)
258. Add Digits
26 Kth Smallest Number In Sorted Matrix (Lai)
26. Remove Duplicates from Sorted Array
2601. Prime Subtraction Operation
261. Graph Valid Tree
263 Two Subsets With Min Difference (Lai)
263. Ugly Number
264 Keep Distance For Identical Elements (Lai)
2667. Create Hello World Function
268. Missing Number
269. Alien Dictionary
2696. Minimum String Length After Removing Substrings
27 Kth Smallest Sum In Two Sorted Arrays (Lai)
27. Remove Element
270 Closest Binary Search Tree Value
271. Encode and Decode Strings
272 Closest Binary Search Tree Value II
273. Integer to English Words
276 Get Count Array (Lai)
278 Frist Bad Version
28 Find the Index of the First Occurrence in a String
280 Sort With 2 Stacks (Lai)
Remove Spaces (Lai)
2824. Count Pairs Whose Sum is Less than Target
283 Move Zeors
283 Move Zeroes
286. Walls and Gates
287. Find the Duplicate Number
288 First Non-Repeating Character In Stream (Lai)
2914. Minimum Number of Changes to Make Binary String Beautiful
295. Find Median from Data Stream
2956 Find Common Elements Between Two Arrays
297. Serialize and Deserialize Binary Tree
3. Longest Substring Without Repeating Characters
300. Longest Increasing Subsequence
3005. Count Elements With Maximum Frequency ✅
3028. Ant on the Boundary
309. Best Time to Buy and Sell Stock with Cooldown
31. Next Permutation
312. Burst Balloons
315. Count of Smaller Numbers After Self
318 Maximum Product of Word Lengths
3213. Construct String with Minimum Cost
322. Coin Change ❤️🔥
323. Number of Connected Components in an Undirected Graph
325 Heapify (Lai)
325. Maximum Size Subarray Sum Equals k
329. Longest Increasing Path in a Matrix
3295. Report Spam Message
3296. Minimum Number of Seconds to Make Mountain Height Zero
33. Search in Rotated Sorted Array
3300. Minimum Element After Replacement With Digit Sum
3301. Maximize the Total Height of Unique Towers
3302. Find the Lexicographically Smallest Valid Sequence
3303. Find the Occurrence of First Almost Equal Substring
3309. Maximum Possible Number by Binary Concatenation
3310. Remove Methods From Project
332. Reconstruct Itinerary
3324. Find the Sequence of Strings Appeared on the Screen
3325. Count Substrings With K-Frequency Characters I
3326. Minimum Division Operations to Make Array Non Decreasing
3327. Check if DFS Strings Are Palindromes
3349. Adjacent Increasing Subarrays Detection I
3350. Adjacent Increasing Subarrays Detection II
3351. Sum of Good Subsequences
3352. Count K-Reducible Numbers Less Than N
3370. Smallest Number With All Set Bits
3371. Identify the Largest Outlier in an Array
3372. Maximize the Number of Target Nodes After Connecting Trees I
3373. Maximize the Number of Target Nodes After Connecting Trees II
338. Counting Bits
34 Reverse Linked List (iterative) (Lai)
34. Find First and Last Position of Element in Sorted Array
343 Integer Break
344. Reverse String
346. Moving Average from Data Stream
347. Top K Frequent Elements
349. Intersection of Two Arrays
35. Search Insert Position
351. Android Unlock Patterns
354. Russian Doll Envelopes
355. Design Twitter
359. Logger Rate Limiter
36. Valid Sudoku
363 Heap Offer Operation (Lai)
367 Heap Update Operation (Lai)
371. Sum of Two Integers
373 Find K Pairs with Smallest Sums
374 Guess Number Higher or Lower
375 Guess Number Higher or Lower II
377. Combination Sum IV
378 Kth Smallest Element in a Sorted Matrix
380. Insert Delete GetRandom O(1)
384. Shuffle an Array
387 First Unique Character in a String
389. Find the Difference
39 Insert In Sorted Linked List (Lai)
39. Combination Sum
392 Is Subsequence
394. Decode String
395 Remove Certain Characters (Lai)
397 Right Shift By N Characters (Lai)
398 All Anagrams (Lai)
399. Evaluate Division
Selection Sort
4. Median of Two Sorted Arrays
40 Merge Two Sorted Linked Lists (Lai)
40. Combination Sum II
404 Sum of Left Leaves
407 Trapping Rain Water II
408 Valid Word Abbreviation
409. Longest Palindrome
41. First Missing Positive
410. Split Array Largest Sum
412. Fizz Buzz
414 Remove Linked List Elements (Lai)
414. Third Maximum Number
416. Partition Equal Subset Sum
417. Pacific Atlantic Water Flow
42. Trapping Rain Water
424. Longest Repeating Character Replacement
425. Word Squares
428. Serialize and Deserialize N-ary Tree
429. N-ary Tree Level Order Traversal
43. Multiply Strings
430 Course Schedule II (Lai)
431 Word Search II (Lai)
435. Non-overlapping Intervals
437 Path Sum III
438 Find All Anagrams in a String
442. Find All Duplicates in an Array
443 String Compression
45. Jump Game II
450 Delete Node in a BST
46 Check If Binary Tree Is Balanced (Lai)
46 Permutations
46. Permutations
463. Island Perimeter
464 Can I Win
47 Check If Binary Tree Is Completed (Lai)
47 Permutations II
47 Permutations II
473 Matchsticks to Square
48. Rotate Image
482. License Key Formatting
485 Max Consecutive Ones
489. Robot Room Cleaner
49. Group Anagrams
494. Target Sum
496 Next Greater Element I
5. Longest Palindromic Substring
50. Pow(x, n)
503 Next Greater Element II
506. Relative Ranks
509 Fibonacci Number
509 Fibonacci Number
51. N-Queens
513. Find Bottom Left Tree Value
518. Coin Change II
52 N-Queens II
52 Search In Binary Search Tree (Lai)
523 Flatten Binary Tree to Linked List (Lai)
53 Delete In Binary Search Tree (Lai)
53. Maximum Subarray
54. Spiral Matrix
540 Single Element in a Sorted Array
543. Diameter of Binary Tree
547. Number of Provinces
55. Jump Game
556 Next Greater Element III
56 Bipartite (Lai)
56. Merge Intervals
560 Subarray Sum Equals K
562. Longest Line of Consecutive One in Matrix
564. Find the Closest Palindrome
567. Permutation in String
57. Insert Interval
572. Subtree of Another Tree
58 Length of Last Word
59 Spiral Matrix II
62. Unique Paths
621. Task Scheduler
63 All Subsets II (Lai)
636 Smallest Element Larger than Target (Lai)
638 Largest Square Of Matches (Lai)
638 Largest Square Of Matches
639 Max Path Sum From Leaf To Root (Lai)
64. Minimum Path Sum
640 All Subsets of Size K (Lai)
642 All Valid Permutations Of Parentheses III (Lai)
644 Common Elements In K Sorted Lists (Lai)
645 Deque By Three Stacks (Lai)
647 Lowest Common Ancestor V (Lai)
647. Palindromic Substrings
648 Lowest Common Ancestor VI (Lai)
649 String Replace (Lai)
65 All Permutations II (Lai)
65 Valid Number
650 Common Numbers Of Two Arrays I(Array version) (Lai)
651 Common Numbers Of Two Arrays II(Array version) (Lai)
652 Common Numbers Of Two Sorted Arrays(Array version) (Lai)
653 Two Sum IV - Input is a BST
655 Pre-order Traversal Of Binary Tree (recursive) (Lai)
657 Can I Win II (Lai)
658 Find K Closest Elements
66. Plus One
661 Word Ladder (Lai)
662 Word Ladder II (Lai)
665 Pacific Atlantic Flow (Lai)
666 Path Sum IV
67 Top K Frequent Words (Lai)
673 Number of Longest Increasing Subsequence
674 Longest Continuous Increasing Subsequence
678 Next Greater Number I (Lai)
678. Valid Parenthesis String
68 Missing Number I (Lai)
680. Valid Palindrome II
681 Seven Puzzle (Lai)
681. Next Closest Time
683 Count Ascending Subsequence
684. Redundant Connection
692 Top K Frequent Words
694. Number of Distinct Islands
695. Max Area of Island
7. Reverse Integer
70. Climbing Stairs
700 Search in a Binary Search Tree
701 Insert into a Binary Search Tree
702 Search in a Sorted Array of Unknown Size
703. Kth Largest Element in a Stream
704. Binary Search
709 To Lower Case
711. Number of Distinct Islands II
713. Subarray Product Less Than K
72. Edit Distance
720. Longest Word in Dictionary
73 Combinations Of Coins (Lai)
73. Set Matrix Zeroes
739. Daily Temperatures
74. Search a 2D Matrix
743. Network Delay Time
744 Find Smallest Letter Greater Than Target
746. Min Cost Climbing Stairs
753. Cracking the Safe
76 All Unique Characters I (Lai)
76. Minimum Window Substring
763. Partition Labels
764 Largest Plus Sign
77 All Unique Characters II (Lai)
77. Combinations
771. Jewels and Stones
772. Basic Calculator III
773 Sliding Puzzle
778. Swim in Rising Water
78. Subsets
785 Is Graph Bipartite?
786 K-th Smallest Prime Fraction
787. Cheapest Flights Within K Stops
79 Remove Adjacent Repeated Characters I (Lai)
79. Word Search
796 Rotate String
797. All Paths From Source to Target
8. String to Integer (atoi)
80. Remove Duplicates from Sorted Array II
809. Expressive Words
82 Remove Adjacent Repeated Characters IV (Lai)
82 Remove Adjacent Repeated Characters IV
833. Find And Replace in String
84. Largest Rectangle in Histogram
844. Backspace String Compare
846. Hand of Straights
849. Maximize Distance to Closest Person
85 Determine If One String Is Another's Substring (Lai)
85 Maximal Rectangle
853. Car Fleet
857. Minimum Cost to Hire K Workers
86 Longest Ascending SubArray
86 Partition List
87 Max Product Of Cutting Rope (Lai)
875. Koko Eating Bananas
876. Middle of the Linked List
88. Merge Sorted Array
885 Spiral Matrix III
888. Fair Candy Swap
9 Merge Sort (Lai)
90. Subsets II
904. Fruit Into Baskets
91. Decode Ways
912 Sort an Array (Merge Sort)
912 Sort an Array (Quick Sort)
92. Reverse Linked List II
929. Unique Email Addresses
930. Binary Subarrays With Sum
938 Range Sum of BST
939. Minimum Area Rectangle
94 Binary Tree Inorder Traversal (recursive)
94 Binary Tree Inorder Traversal (recursive)
947. Most Stones Removed with Same Row or Column
948. Bag of Tokens
951. Flip Equivalent Binary Trees
958 Check Completeness of a Binary Tree
97. Interleaving String
973. K Closest Points to Origin
975. Odd Even Jump
98. Validate Binary Search Tree
981. Time Based Key-Value Store
994. Rotting Oranges
Bitmask
Dynamic Programming
How integer number change to string?
L33 Search in Rotated Sorted Array
L35 Search Insert Position
L69 Sqrt(x)
Algorithms
Algorithms
Divide & Conquer
Index
The Knuth-Morris-Pratt algorithm
Memoization
MergeSort
Binary Search
Bit Manipulation
Dynamic Programming
Graph
Greedy
Linked List
Monotonic Stack
Sliding Window
Quantum
Quantum
Grover
QKD
Architecture
Database
OS
Network
Tools
Projects
Blog
2040 Kth Smallest Product of Two Sorted Arrays
Back to top