Some solved problems from LeetCode on Java.
Profile on LeetCode: fartem.
Name | Link to LeetCode | Link to solution |
---|---|---|
1. Two Sum | Link | Link |
9. Palindrome Number | Link | Link |
13. Roman to Integer | Link | Link |
14. Longest Common Prefix | Link | Link |
20. Valid Parentheses | Link | Link |
21. Merge Two Sorted Lists | Link | Link |
27. Remove Element | Link | Link |
35. Search Insert Position | Link | Link |
58. Length of Last Word | Link | Link |
66. Plus One | Link | Link |
67. Add Binary | Link | Link |
69. Sqrt(x) | Link | Link |
70. Climbing Stairs | Link | Link |
83. Remove Duplicates from Sorted List | Link | Link |
88. Merge Sorted Array | Link | Link |
94. Binary Tree Inorder Traversal | Link | Link |
100. Same Tree | Link | Link |
101. Symmetric Tree | Link | Link |
104. Maximum Depth of Binary Tree | Link | Link |
108. Convert Sorted Array to Binary Search Tree | Link | Link |
110. Balanced Binary Tree | Link | Link |
111. Minimum Depth of Binary Tree | Link | Link |
112. Path Sum | Link | Link |
118. Pascal's Triangle | Link | Link |
119. Pascal's Triangle II | Link | Link |
121. Best Time to Buy and Sell Stock | Link | Link |
125. Valid Palindrome | Link | Link |
136. Single Number | Link | Link |
141. Linked List Cycle | Link | Link |
144. Binary Tree Preorder Traversal | Link | Link |
145. Binary Tree Postorder Traversal | Link | Link |
160. Intersection of Two Linked Lists | Link | Link |
168. Excel Sheet Column Title | Link | Link |
169. Majority Element | Link | Link |
171. Excel Sheet Column Number | Link | Link |
190. Reverse Bits | Link | Link |
191. Number of 1 Bits | Link | Link |
202. Happy Number | Link | Link |
203. Remove Linked List Elements | Link | Link |
205. Isomorphic Strings | Link | Link |
206. Reverse Linked List | Link | Link |
217. Contains Duplicate | Link | Link |
219. Contains Duplicate II | Link | Link |
225. Implement Stack using Queues | Link | Link |
226. Invert Binary Tree | Link | Link |
228. Summary Ranges | Link | Link |
231. Power of Two | Link | Link |
232. Implement Queue using Stacks | Link | Link |
234. Palindrome Linked List | Link | Link |
242. Valid Anagram | Link | Link |
257. Binary Tree Paths | Link | Link |
263. Ugly Number | Link | Link |
258. Add Digits | Link | Link |
268. Missing Number | Link | Link |
278. First Bad Version | Link | Link |
290. Word Pattern | Link | Link |
292. Nim Game | Link | Link |
303. Range Sum Query - Immutable | Link | Link |
326. Power of Three | Link | Link |
338. Counting Bits | Link | Link |
342. Power of Four | Link | Link |
344. Reverse String | Link | Link |
345. Reverse Vowels of a String | Link | Link |
349. Intersection of Two Arrays | Link | Link |
350. Intersection of Two Arrays II | Link | Link |
367. Valid Perfect Square | Link | Link |
374. Guess Number Higher or Lower | Link | Link |
383. Ransom Note | Link | Link |
387. First Unique Character in a String | Link | Link |
389. Find the Difference | Link | Link |
392. Is Subsequence | Link | Link |
404. Sum of Left Leaves | Link | Link |
405. Convert a Number to Hexadecimal | Link | Link |
409. Longest Palindrome | Link | Link |
412. Fizz Buzz | Link | Link |
414. Third Maximum Number | Link | Link |
415. Add Strings | Link | Link |
434. Number of Segments in a String | Link | Link |
441. Arranging Coins | Link | Link |
448. Find All Numbers Disappeared in an Array | Link | Link |
455. Assign Cookies | Link | Link |
459. Repeated Substring Pattern | Link | Link |
461. Hamming Distance | Link | Link |
463. Island Perimeter | Link | Link |
476. Number Complement | Link | Link |
482. License Key Formatting | Link | Link |
485. Max Consecutive Ones | Link | Link |
492. Construct the Rectangle | Link | Link |
496. Next Greater Element I | Link | Link |
500. Keyboard Row | Link | Link |
501. Find Mode in Binary Search Tree | Link | Link |
504. Base 7 | Link | Link |
506. Relative Ranks | Link | Link |
507. Perfect Number | Link | Link |
509. Fibonacci Number | Link | Link |
520. Detect Capital | Link | Link |
521. Longest Uncommon Subsequence I | Link | Link |
530. Minimum Absolute Difference in BST | Link | Link |
543. Diameter of Binary Tree | Link | Link |
551. Student Attendance Record I | Link | Link |
557. Reverse Words in a String III | Link | Link |
559. Maximum Depth of N-ary Tree | Link | Link |
561. Array Partition | Link | Link |
563. Binary Tree Tilt | Link | Link |
566. Reshape the Matrix | Link | Link |
572. Subtree of Another Tree | Link | Link |
589. N-ary Tree Preorder Traversal | Link | Link |
590. N-ary Tree Postorder Traversal | Link | Link |
594. Longest Harmonious Subsequence | Link | Link |
599. Minimum Index Sum of Two Lists | Link | Link |
606. Construct String from Binary Tree | Link | Link |
617. Merge Two Binary Trees | Link | Link |
628. Maximum Product of Three Numbers | Link | Link |
637. Average of Levels in Binary Tree | Link | Link |
643. Maximum Average Subarray I | Link | Link |
645. Set Mismatch | Link | Link |
653. Two Sum IV - Input is a BST | Link | Link |
657. Robot Return to Origin | Link | Link |
671. Second Minimum Node In a Binary Tree | Link | Link |
674. Longest Continuous Increasing Subsequence | Link | Link |
680. Valid Palindrome II | Link | Link |
682. Baseball Game | Link | Link |
693. Binary Number with Alternating Bits | Link | Link |
700. Search in a Binary Search Tree | Link | Link |
703. Kth Largest Element in a Stream | Link | Link |
704. Binary Search | Link | Link |
705. Design HashSet | Link | Link |
706. Design HashMap | Link | Link |
709. To Lower Case | Link | Link |
717. 1-bit and 2-bit Characters | Link | Link |
724. Find Pivot Index | Link | Link |
728. Self Dividing Numbers | Link | Link |
733. Flood Fill | Link | Link |
744. Find Smallest Letter Greater Than Target | Link | Link |
746. Min Cost Climbing Stairs | Link | Link |
747. Largest Number At Least Twice of Others | Link | Link |
762. Prime Number of Set Bits in Binary Representation | Link | Link |
766. Toeplitz Matrix | Link | Link |
771. Jewels and Stones | Link | Link |
783. Minimum Distance Between BST Nodes | Link | Link |
796. Rotate String | Link | Link |
804. Unique Morse Code Words | Link | Link |
806. Number of Lines To Write String | Link | Link |
812. Largest Triangle Area | Link | Link |
819. Most Common Word | Link | Link |
821. Shortest Distance to a Character | Link | Link |
830. Positions of Large Groups | Link | Link |
832. Flipping an Image | Link | Link |
844. Backspace String Compare | Link | Link |
859. Buddy Strings | Link | Link |
860. Lemonade Change | Link | Link |
867. Transpose Matrix | Link | Link |
868. Binary Gap | Link | Link |
872. Leaf-Similar Trees | Link | Link |
876. Middle of the Linked List | Link | Link |
884. Uncommon Words from Two Sentences | Link | Link |
896. Monotonic Array | Link | Link |
897. Increasing Order Search Tree | Link | Link |
905. Sort Array By Parity | Link | Link |
908. Smallest Range I | Link | Link |
917. Reverse Only Letters | Link | Link |
922. Sort Array By Parity II | Link | Link |
925. Long Pressed Name | Link | Link |
929. Unique Email Addresses | Link | Link |
933. Number of Recent Calls | Link | Link |
938. Range Sum of BST | Link | Link |
941. Valid Mountain Array | Link | Link |
942. DI String Match | Link | Link |
944. Delete Columns to Make Sorted | Link | Link |
953. Verifying an Alien Dictionary | Link | Link |
961. N-Repeated Element in Size 2N Array | Link | Link |
965. Univalued Binary Tree | Link | Link |
976. Largest Perimeter Triangle | Link | Link |
977. Squares of a Sorted Array | Link | Link |
989. Add to Array-Form of Integer | Link | Link |
993. Cousins in Binary Tree | Link | Link |
997. Find the Town Judge | Link | Link |
1002. Find Common Characters | Link | Link |
1005. Maximize Sum Of Array After K Negations | Link | Link |
1009. Complement of Base 10 Integer | Link | Link |
1018. Binary Prefix Divisible By 5 | Link | Link |
1021. Remove Outermost Parentheses | Link | Link |
1022. Sum of Root To Leaf Binary Numbers | Link | Link |
1025. Divisor Game | Link | Link |
1046. Last Stone Weight | Link | Link |
1047. Remove All Adjacent Duplicates In String | Link | Link |
1051. Height Checker | Link | Link |
1071. Greatest Common Divisor of Strings | Link | Link |
1078. Occurrences After Bigram | Link | Link |
1089. Duplicate Zeros | Link | Link |
1103. Distribute Candies to People | Link | Link |
1108. Defanging an IP Address | Link | Link |
1114. Print in Order | Link | Link |
1137. N-th Tribonacci Number | Link | Link |
1154. Day of the Year | Link | Link |
1160. Find Words That Can Be Formed by Characters | Link | Link |
1184. Distance Between Bus Stops | Link | Link |
1185. Day of the Week | Link | Link |
1189. Maximum Number of Balloons | Link | Link |
1200. Minimum Absolute Difference | Link | Link |
1207. Unique Number of Occurrences | Link | Link |
1217. Minimum Cost to Move Chips to The Same Position | Link | Link |
1221. Split a String in Balanced Strings | Link | Link |
1232. Check If It Is a Straight Line | Link | Link |
1252. Cells with Odd Values in a Matrix | Link | Link |
1266. Minimum Time Visiting All Points | Link | Link |
1275. Find Winner on a Tic Tac Toe Game | Link | Link |
1281. Subtract the Product and Sum of Digits of an Integer | Link | Link |
1287. Element Appearing More Than 25% In Sorted Array | Link | Link |
1290. Convert Binary Number in a Linked List to Integer | Link | Link |
1295. Find Numbers with Even Number of Digits | Link | Link |
1299. Replace Elements with Greatest Element on Right Side | Link | Link |
1304. Find N Unique Integers Sum up to Zero | Link | Link |
1309. Decrypt String from Alphabet to Integer Mapping | Link | Link |
1313. Decompress Run-Length Encoded List | Link | Link |
1317. Convert Integer to the Sum of Two No-Zero Integers | Link | Link |
1323. Maximum 69 Number | Link | Link |
1332. Remove Palindromic Subsequences | Link | Link |
1337. The K Weakest Rows in a Matrix | Link | Link |
1342. Number of Steps to Reduce a Number to Zero | Link | Link |
1346. Check If N and Its Double Exist | Link | Link |
1351. Count Negative Numbers in a Sorted Matrix | Link | Link |
1356. Sort Integers by The Number of 1 Bits | Link | Link |
1360. Number of Days Between Two Dates | Link | Link |
1365. How Many Numbers Are Smaller Than the Current Number | Link | Link |
1370. Increasing Decreasing String | Link | Link |
1374. Generate a String With Characters That Have Odd Counts | Link | Link |
1379. Find a Corresponding Node of a Binary Tree in a Clone of That Tree | Link | Link |
1385. Find the Distance Value Between Two Arrays | Link | Link |
1389. Create Target Array in the Given Order | Link | Link |
1399. Count Largest Group | Link | Link |
1403. Minimum Subsequence in Non-Increasing Order | Link | Link |
1408. String Matching in an Array | Link | Link |
1413. Minimum Value to Get Positive Step by Step Sum | Link | Link |
1417. Reformat The String | Link | Link |
1991. Find the Middle Index in Array | Link | Link |
1431. Kids With the Greatest Number of Candies | Link | Link |
1436. Destination City | Link | Link |
1437. Check If All 1's Are at Least Length K Places Away | Link | Link |
1446. Consecutive Characters | Link | Link |
1450. Number of Students Doing Homework at a Given Time | Link | Link |
1455. Check If a Word Occurs As a Prefix of Any Word in a Sentence | Link | Link |
1460. Make Two Arrays Equal by Reversing Sub-arrays | Link | Link |
1464. Maximum Product of Two Elements in an Array | Link | Link |
1470. Shuffle the Array | Link | Link |
1475. Final Prices With a Special Discount in a Shop | Link | Link |
1480. Running Sum of 1d Array | Link | Link |
1486. XOR Operation in an Array | Link | Link |
1491. Average Salary Excluding the Minimum and Maximum Salary | Link | Link |
1496. Path Crossing | Link | Link |
1502. Can Make Arithmetic Progression From Sequence | Link | Link |
1507. Reformat Date | Link | Link |
1512. Number of Good Pairs | Link | Link |
1518. Water Bottles | Link | Link |
1523. Count Odd Numbers in an Interval Range | Link | Link |
1528. Shuffle String | Link | Link |
1534. Count Good Triplets | Link | Link |
1539. Kth Missing Positive Number | Link | Link |
1544. Make The String Great | Link | Link |
1550. Three Consecutive Odds | Link | Link |
1556. Thousand Separator | Link | Link |
1566. Detect Pattern of Length M Repeated K or More Times | Link | Link |
1572. Matrix Diagonal Sum | Link | Link |
1576. Replace All ?'s to Avoid Consecutive Repeating Characters | Link | Link |
1582. Special Positions in a Binary Matrix | Link | Link |
1588. Sum of All Odd Length Subarrays | Link | Link |
1592. Rearrange Spaces Between Words | Link | Link |
1598. Crawler Log Folder | Link | Link |
1603. Design Parking System | Link | Link |
1608. Special Array With X Elements Greater Than or Equal X | Link | Link |
1614. Maximum Nesting Depth of the Parentheses | Link | Link |
1619. Mean of Array After Removing Some Elements | Link | Link |
1624. Largest Substring Between Two Equal Characters | Link | Link |
1629. Slowest Key | Link | Link |
1636. Sort Array by Increasing Frequency | Link | Link |
1646. Get Maximum in Generated Array | Link | Link |
1652. Defuse the Bomb | Link | Link |
1662. Check If Two String Arrays are Equivalent | Link | Link |
1668. Maximum Repeating Substring | Link | Link |
1672. Richest Customer Wealth | Link | Link |
1678. Goal Parser Interpretation | Link | Link |
1684. Count the Number of Consistent Strings | Link | Link |
1688. Count of Matches in Tournament | Link | Link |
1694. Reformat Phone Number | Link | Link |
1700. Number of Students Unable to Eat Lunch | Link | Link |
1704. Determine if String Halves Are Alike | Link | Link |
1710. Maximum Units on a Truck | Link | Link |
1716. Calculate Money in Leetcode Bank | Link | Link |
1720. Decode XORed Array | Link | Link |
1725. Number Of Rectangles That Can Form The Largest Square | Link | Link |
1732. Find the Highest Altitude | Link | Link |
1736. Latest Time by Replacing Hidden Digits | Link | Link |
1748. Sum of Unique Elements | Link | Link |
1752. Check if Array Is Sorted and Rotated | Link | Link |
1768. Merge Strings Alternately | Link | Link |
1773. Count Items Matching a Rule | Link | Link |
1779. Find Nearest Point That Has the Same X or Y Coordinate | Link | Link |
1784. Check if Binary String Has at Most One Segment of Ones | Link | Link |
1790. Check if One String Swap Can Make Strings Equal | Link | Link |
1791. Find Center of Star Graph | Link | Link |
1796. Second Largest Digit in a String | Link | Link |
1800. Maximum Ascending Subarray Sum | Link | Link |
1805. Number of Different Integers in a String | Link | Link |
1812. Determine Color of a Chessboard Square | Link | Link |
1816. Truncate Sentence | Link | Link |
1822. Sign of the Product of an Array | Link | Link |
1827. Minimum Operations to Make the Array Increasing | Link | Link |
1832. Check if the Sentence Is Pangram | Link | Link |
1837. Sum of Digits in Base K | Link | Link |
1844. Replace All Digits with Characters | Link | Link |
1848. Minimum Distance to the Target Element | Link | Link |
1859. Sorting the Sentence | Link | Link |
1863. Sum of All Subset XOR Totals | Link | Link |
1869. Longer Contiguous Segments of Ones than Zeros | Link | Link |
1876. Substrings of Size Three with Distinct Characters | Link | Link |
1880. Check if Word Equals Summation of Two Words | Link | Link |
1886. Determine Whether Matrix Can Be Obtained By Rotation | Link | Link |
1893. Check if All the Integers in a Range Are Covered | Link | Link |
1897. Redistribute Characters to Make All Strings Equal | Link | Link |
1903. Largest Odd Number in String | Link | Link |
1909. Remove One Element to Make the Array Strictly Increasing | Link | Link |
1913. Maximum Product Difference Between Two Pairs | Link | Link |
1920. Build Array from Permutation | Link | Link |
1925. Count Square Sum Triples | Link | Link |
1929. Concatenation of Array | Link | Link |
1935. Maximum Number of Words You Can Type | Link | Link |
1941. Check if All Characters Have Equal Number of Occurrences | Link | Link |
1952. Three Divisors | Link | Link |
1957. Delete Characters to Make Fancy String | Link | Link |
1961. Check If String Is a Prefix of Array | Link | Link |
1967. Number of Strings That Appear as Substrings in Word | Link | Link |
1971. Find if Path Exists in Graph | Link | Link |
1974. Minimum Time to Type Word Using Special Typewriter | Link | Link |
1979. Find Greatest Common Divisor of Array | Link | Link |
1984. Minimum Difference Between Highest and Lowest of K Scores | Link | Link |
1991. Find the Middle Index in Array | Link | Link |
1995. Count Special Quadruplets | Link | Link |
2000. Reverse Prefix of Word | Link | Link |
2006. Count Number of Pairs With Absolute Difference K | Link | Link |
2011. Final Value of Variable After Performing Operations | Link | Link |
2016. Maximum Difference Between Increasing Elements | Link | Link |
2022. Convert 1D Array Into 2D Array | Link | Link |
2027. Minimum Moves to Convert String | Link | Link |
2032. Two Out of Three | Link | Link |
2037. Minimum Number of Moves to Seat Everyone | Link | Link |
2042. Check if Numbers Are Ascending in a Sentence | Link | Link |
2047. Number of Valid Words in a Sentence | Link | Link |
2053. Kth Distinct String in an Array | Link | Link |
2057. Smallest Index With Equal Value | Link | Link |
2062. Count Vowel Substrings of a String | Link | Link |
2068. Check Whether Two Strings are Almost Equivalent | Link | Link |
2073. Time Needed to Buy Tickets | Link | Link |
2078. Two Furthest Houses With Different Colors | Link | Link |
2085. Count Common Words With One Occurrence | Link | Link |
2089. Find Target Indices After Sorting Array | Link | Link |
2094. Finding 3-Digit Even Numbers | Link | Link |
2099. Find Subsequence of Length K With the Largest Sum | Link | Link |
2103. Rings and Rods | Link | Link |
2108. Find First Palindromic String in the Array | Link | Link |
2114. Maximum Number of Words Found in Sentences | Link | Link |
2119. A Number After a Double Reversal | Link | Link |
2124. Check if All A's Appears Before All B's | Link | Link |
2129. Capitalize the Title | Link | Link |
2133. Check if Every Row and Column Contains All Numbers | Link | Link |
2138. Divide a String Into Groups of Size k | Link | Link |
2148. Count Elements With Strictly Smaller and Greater Elements | Link | Link |
2154. Keep Multiplying Found Values by Two | Link | Link |
2160. Minimum Sum of Four Digit Number After Splitting Digits | Link | Link |
2164. Sort Even and Odd Indices Independently | Link | Link |
2169. Count Operations to Obtain Zero | Link | Link |
2176. Count Equal and Divisible Pairs in an Array | Link | Link |
2180. Count Integers With Even Digit Sum | Link | Link |
2185. Counting Words With a Given Prefix | Link | Link |
2190. Most Frequent Number Following Key In an Array | Link | Link |
2194. Cells in a Range on an Excel Sheet | Link | Link |
2206. Divide Array Into Equal Pairs | Link | Link |
2210. Count Hills and Valleys in an Array | Link | Link |
2215. Find the Difference of Two Arrays | Link | Link |
2220. Minimum Bit Flips to Convert Number | Link | Link |
2231. Largest Number After Digit Swaps by Parity | Link | Link |
2235. Add Two Integers | Link | Link |
2236. Root Equals Sum of Children | Link | Link |
2239. Find Closest Number to Zero | Link | Link |
2243. Calculate Digit Sum of a String | Link | Link |
2248. Intersection of Multiple Arrays | Link | Link |
2255. Count Prefixes of a Given String | Link | Link |
2259. Remove Digit From Number to Maximize Result | Link | Link |
2264. Largest 3-Same-Digit Number in String | Link | Link |
2278. Percentage of Letter in String | Link | Link |
2283. Check if Number Has Equal Digit Count and Digit Value | Link | Link |
2287. Rearrange Characters to Make Target String | Link | Link |
2293. Min Max Game | Link | Link |
2299. Strong Password Checker II | Link | Link |
2303. Calculate Amount Paid in Taxes | Link | Link |
2309. Greatest English Letter in Upper and Lower Case | Link | Link |
2315. Count Asterisks | Link | Link |
2319. Check if Matrix Is X-Matrix | Link | Link |
2325. Decode the Message | Link | Link |
2331. Evaluate Boolean Binary Tree | Link | Link |
2341. Maximum Number of Pairs in Array | Link | Link |
2347. Best Poker Hand | Link | Link |
2351. First Letter to Appear Twice | Link | Link |
2335. Minimum Amount of Time to Fill Cups | Link | Link |
2357. Make Array Zero by Subtracting Equal Amounts | Link | Link |
2367. Number of Arithmetic Triplets | Link | Link |
2363. Merge Similar Items | Link | Link |
2373. Largest Local Values in a Matrix | Link | Link |
2379. Minimum Recolors to Get K Consecutive Black Blocks | Link | Link |
2383. Minimum Hours of Training to Win a Competition | Link | Link |
2389. Longest Subsequence With Limited Sum | Link | Link |
2395. Find Subarrays With Equal Sum | Link | Link |
2399. Check Distances Between Same Letters | Link | Link |
2404. Most Frequent Even Element | Link | Link |
2413. Smallest Even Multiple | Link | Link |
2418. Sort the People | Link | Link |
2423. Remove Letter To Equalize Frequency | Link | Link |
2427. Number of Common Factors | Link | Link |
2432. The Employee That Worked on the Longest Task | Link | Link |
2441. Largest Positive Integer That Exists With Its Negative | Link | Link |
2446. Determine if Two Events Have Conflict | Link | Link |
2455. Average Value of Even Numbers That Are Divisible by Three | Link | Link |
2460. Apply Operations to an Array | Link | Link |
2469. Convert the Temperature | Link | Link |
2475. Number of Unequal Triplets in Array | Link | Link |
2481. Minimum Cuts to Divide a Circle | Link | Link |
2485. Find the Pivot Integer | Link | Link |
2490. Circular Sentence | Link | Link |
2496. Maximum Value of a String in an Array | Link | Link |
2500. Delete Greatest Value in Each Row | Link | Link |
2506. Count Pairs Of Similar Strings | Link | Link |
2511. Maximum Enemy Forts That Can Be Captured | Link | Link |
2515. Shortest Distance to Target String in a Circular Array | Link | Link |
2520. Count the Digits That Divide a Number | Link | Link |
2525. Categorize Box According to Criteria | Link | Link |
2529. Maximum Count of Positive Integer and Negative Integer | Link | Link |
2535. Difference Between Element Sum and Digit Sum of an Array | Link | Link |
2540. Minimum Common Value | Link | Link |
2544. Alternating Digit Sum | Link | Link |
2549. Count Distinct Numbers on Board | Link | Link |
Name | Link to LeetCode | Link to solution |
---|---|---|
2. Add Two Numbers | Link | Link |
3. Longest Substring Without Repeating Characters | Link | Link |
5. Longest Palindromic Substring | Link | Link |
7. Reverse Integer | Link | Link |
8. String to Integer (atoi) | Link | Link |
11. Container With Most Water | Link | Link |
12. Integer to Roman | Link | Link |
15. 3Sum | Link | Link |
16. 3Sum Closest | Link | Link |
17. Letter Combinations of a Phone Number | Link | Link |
19. Remove Nth Node From End of List | Link | Link |
22. Generate Parentheses | Link | Link |
24. Swap Nodes in Pairs | Link | Link |
28. Find the Index of the First Occurrence in a String | Link | Link |
29. Divide Two Integers | Link | Link |
33. Search in Rotated Sorted Array | Link | Link |
34. Find First and Last Position of Element in Sorted Array | Link | Link |
36. Valid Sudoku | Link | Link |
38. Count and Say | Link | Link |
39. Combination Sum | Link | Link |
43. Multiply Strings | Link | Link |
46. Permutations | Link | Link |
48. Rotate Image | Link | Link |
49. Group Anagrams | Link | Link |
53. Maximum Subarray | Link | Link |
54. Spiral Matrix | Link | Link |
55. Jump Game | Link | Link |
56. Merge Intervals | Link | Link |
57. Insert Interval | Link | Link |
59. Spiral Matrix II | Link | Link |
61. Rotate List | Link | Link |
62. Unique Paths | Link | Link |
71. Simplify Path | Link | Link |
74. Search a 2D Matrix | Link | Link |
75. Sort Colors | Link | Link |
78. Subsets | Link | Link |
82. Remove Duplicates from Sorted List II | Link | Link |
86. Partition List | Link | Link |
92. Reverse Linked List II | Link | Link |
95. Unique Binary Search Trees II | Link | Link |
96. Unique Binary Search Trees | Link | Link |
98. Validate Binary Search Tree | Link | Link |
99. Recover Binary Search Tree | Link | Link |
102. Binary Tree Level Order Traversal | Link | Link |
103. Binary Tree Zigzag Level Order Traversal | Link | Link |
105. Construct Binary Tree from Preorder and Inorder Traversal | Link | Link |
106. Construct Binary Tree from Inorder and Postorder Traversal | Link | Link |
107. Binary Tree Level Order Traversal II | Link | Link |
109. Convert Sorted List to Binary Search Tree | Link | Link |
113. Path Sum II | Link | Link |
114. Flatten Binary Tree to Linked List | Link | Link |
116. Populating Next Right Pointers in Each Node | Link | Link |
117. Populating Next Right Pointers in Each Node II | Link | Link |
120. Triangle | Link | Link |
128. Longest Consecutive Sequence | Link | Link |
129. Sum Root to Leaf Numbers | Link | Link |
133. Clone Graph | Link | Link |
134. Gas Station | Link | Link |
138. Copy List with Random Pointer | Link | Link |
142. Linked List Cycle II | Link | Link |
143. Reorder List | Link | Link |
146. LRU Cache | Link | Link |
147. Insertion Sort List | Link | Link |
148. Sort List | Link | Link |
150. Evaluate Reverse Polish Notation | Link | Link |
151. Reverse Words in a String | Link | Link |
155. Min Stack | Link | Link |
165. Compare Version Numbers | Link | Link |
167. Two Sum II - Input Array Is Sorted | Link | Link |
173. Binary Search Tree Iterator | Link | Link |
179. Largest Number | Link | Link |
187. Repeated DNA Sequences | Link | Link |
189. Rotate Array | Link | Link |
199. Binary Tree Right Side View | Link | Link |
200. Number of Islands | Link | Link |
204. Count Primes | Link | Link |
208. Implement Trie (Prefix Tree) | Link | Link |
209. Minimum Size Subarray Sum | Link | Link |
215. Kth Largest Element in an Array | Link | Link |
222. Count Complete Tree Nodes | Link | Link |
227. Basic Calculator II | Link | Link |
230. Kth Smallest Element in a BST | Link | Link |
235. Lowest Common Ancestor of a Binary Search Tree | Link | Link |
236. Lowest Common Ancestor of a Binary Tree | Link | Link |
237. Delete Node in a Linked List | Link | Link |
238. Product of Array Except Self | Link | Link |
240. Search a 2D Matrix II | Link | Link |
284. Peeking Iterator | Link | Link |
287. Find the Duplicate Number | Link | Link |
299. Bulls and Cows | Link | Link |
300. Longest Increasing Subsequence | Link | Link |
304. Range Sum Query 2D - Immutable | Link | Link |
316. Remove Duplicate Letters | Link | Link |
318. Maximum Product of Word Lengths | Link | Link |
328. Odd Even Linked List | Link | Link |
331. Verify Preorder Serialization of a Binary Tree | Link | Link |
334. Increasing Triplet Subsequence | Link | Link |
341. Flatten Nested List Iterator | Link | Link |
347. Top K Frequent Elements | Link | Link |
371. Sum of Two Integers | Link | Link |
377. Combination Sum IV | Link | Link |
378. Kth Smallest Element in a Sorted Matrix | Link | Link |
380. Insert Delete GetRandom O(1) | Link | Link |
382. Linked List Random Node | Link | Link |
388. Longest Absolute File Path | Link | Link |
394. Decode String | Link | Link |
398. Random Pick Index | Link | Link |
402. Remove K Digits | Link | Link |
417. Pacific Atlantic Water Flow | Link | Link |
424. Longest Repeating Character Replacement | Link | Link |
429. N-ary Tree Level Order Traversal | Link | Link |
435. Non-overlapping Intervals | Link | Link |
438. Find All Anagrams in a String | Link | Link |
442. Find All Duplicates in an Array | Link | Link |
443. String Compression | Link | Link |
445. Add Two Numbers II | Link | Link |
449. Serialize and Deserialize BST | Link | Link |
450. Delete Node in a BST | Link | Link |
451. Sort Characters By Frequency | Link | Link |
453. Minimum Moves to Equal Array Elements | Link | Link |
456. 132 Pattern | Link | Link |
462. Minimum Moves to Equal Array Elements II | Link | Link |
468. Validate IP Address | Link | Link |
474. Ones and Zeroes | Link | Link |
503. Next Greater Element II | Link | Link |
508. Most Frequent Subtree Sum | Link | Link |
513. Find Bottom Left Tree Value | Link | Link |
515. Find Largest Value in Each Tree Row | Link | Link |
516. Longest Palindromic Subsequence | Link | Link |
523. Continuous Subarray Sum | Link | Link |
524. Longest Word in Dictionary through Deleting | Link | Link |
535. Encode and Decode TinyURL | Link | Link |
538. Convert BST to Greater Tree | Link | Link |
556. Next Greater Element III | Link | Link |
560. Subarray Sum Equals K | Link | Link |
581. Shortest Unsorted Continuous Subarray | Link | Link |
609. Find Duplicate File in System | Link | Link |
621. Task Scheduler | Link | Link |
622. Design Circular Queue | Link | Link |
623. Add One Row to Tree | Link | Link |
641. Design Circular Deque | Link | Link |
647. Palindromic Substrings | Link | Link |
648. Replace Words | Link | Link |
652. Find Duplicate Subtrees | Link | Link |
654. Maximum Binary Tree | Link | Link |
659. Split Array into Consecutive Subsequences | Link | Link |
662. Maximum Width of Binary Tree | Link | Link |
669. Trim a Binary Search Tree | Link | Link |
677. Map Sum Pairs | Link | Link |
678. Valid Parenthesis String | Link | Link |
687. Longest Univalue Path | Link | Link |
692. Top K Frequent Words | Link | Link |
701. Insert into a Binary Search Tree | Link | Link |
707. Design Linked List | Link | Link |
720. Longest Word in Dictionary | Link | Link |
725. Split Linked List in Parts | Link | Link |
729. My Calendar I | Link | Link |
735. Asteroid Collision | Link | Link |
739. Daily Temperatures | Link | Link |
763. Partition Labels | Link | Link |
784. Letter Case Permutation | Link | Link |
797. All Paths From Source to Target | Link | Link |
814. Binary Tree Pruning | Link | Link |
817. Linked List Components | Link | Link |
823. Binary Trees With Factors | Link | Link |
841. Keys and Rooms | Link | Link |
852. Peak Index in a Mountain Array | Link | Link |
856. Score of Parentheses | Link | Link |
858. Mirror Reflection | Link | Link |
863. All Nodes Distance K in Binary Tree | Link | Link |
865. Smallest Subtree with all the Deepest Nodes | Link | Link |
869. Reordered Power of 2 | Link | Link |
880. Decoded String at Index | Link | Link |
889. Construct Binary Tree from Preorder and Postorder Traversal | Link | Link |
890. Find and Replace Pattern | Link | Link |
894. All Possible Full Binary Trees | Link | Link |
901. Online Stock Span | Link | Link |
910. Smallest Range II | Link | Link |
912. Sort an Array | Link | Link |
916. Word Subsets | Link | Link |
919. Complete Binary Tree Inserter | Link | Link |
921. Minimum Add to Make Parentheses Valid | Link | Link |
937. Reorder Data in Log Files | Link | Link |
946. Validate Stack Sequences | Link | Link |
950. Reveal Cards In Increasing Order | Link | Link |
951. Flip Equivalent Binary Trees | Link | Link |
958. Check Completeness of a Binary Tree | Link | Link |
967. Numbers With Same Consecutive Differences | Link | Link |
973. K Closest Points to Origin | Link | Link |
979. Distribute Coins in Binary Tree | Link | Link |
981. Time Based Key-Value Store | Link | Link |
985. Sum of Even Numbers After Queries | Link | Link |
988. Smallest String Starting From Leaf | Link | Link |
998. Maximum Binary Tree II | Link | Link |
1008. Construct Binary Search Tree from Preorder Traversal | Link | Link |
1019. Next Greater Node In Linked List | Link | Link |
1023. Camelcase Matching | Link | Link |
1026. Maximum Difference Between Node and Ancestor | Link | Link |
1038. Binary Search Tree to Greater Sum Tree | Link | Link |
1043. Partition Array for Maximum Sum | Link | Link |
1079. Letter Tile Possibilities | Link | Link |
1081. Smallest Subsequence of Distinct Characters | Link | Link |
1110. Delete Nodes And Return Forest | Link | Link |
1111. Maximum Nesting Depth of Two Valid Parentheses Strings | Link | Link |
1115. Print FooBar Alternately | Link | Link |
1123. Lowest Common Ancestor of Deepest Leaves | Link | Link |
1161. Maximum Level Sum of a Binary Tree | Link | Link |
1171. Remove Zero Sum Consecutive Nodes from Linked List | Link | Link |
1209. Remove All Adjacent Duplicates in String II | Link | Link |
1247. Minimum Swaps to Make Strings Equal | Link | Link |
1248. Count Number of Nice Subarrays | Link | Link |
1249. Minimum Remove to Make Valid Parentheses | Link | Link |
1261. Find Elements in a Contaminated Binary Tree | Link | Link |
1288. Remove Covered Intervals | Link | Link |
1302. Deepest Leaves Sum | Link | Link |
1305. All Elements in Two Binary Search Trees | Link | Link |
1310. XOR Queries of a Subarray | Link | Link |
1315. Sum of Nodes with Even-Valued Grandparent | Link | Link |
1325. Delete Leaves With a Given Value | Link | Link |
1329. Sort the Matrix Diagonally | Link | Link |
1338. Reduce Array Size to The Half | Link | Link |
1339. Maximum Product of Splitted Binary Tree | Link | Link |
1343. Number of Sub-arrays of Size K and Average Greater than or Equal to Threshold | Link | Link |
1347. Minimum Number of Steps to Make Two Strings Anagram | Link | Link |
1358. Number of Substrings Containing All Three Characters | Link | Link |
1367. Linked List in Binary Tree | Link | Link |
1376. Time Needed to Inform All Employees | Link | Link |
1381. Design a Stack With Increment Operation | Link | Link |
1382. Balance a Binary Search Tree | Link | Link |
1387. Sort Integers by The Power Value | Link | Link |
1395. Count Number of Teams | Link | Link |
1396. Design Underground System | Link | Link |
1433. Check If a String Can Break Another String | Link | Link |
1442. Count Triplets That Can Form Two Arrays of Equal XOR | Link | Link |
1448. Count Good Nodes in Binary Tree | Link | Link |
1457. Pseudo-Palindromic Paths in a Binary Tree | Link | Link |
1461. Check If a String Contains All Binary Codes of Size K | Link | Link |
1472. Design Browser History | Link | Link |
1481. Least Number of Unique Integers after K Removals | Link | Link |
1492. The kth Factor of n | Link | Link |
1504. Count Submatrices With All Ones | Link | Link |
1525. Number of Good Ways to Split a String | Link | Link |
1529. Minimum Suffix Flips | Link | Link |
1530. Number of Good Leaf Nodes Pairs | Link | Link |
1557. Minimum Number of Vertices to Reach All Nodes | Link | Link |
1609. Even Odd Tree | Link | Link |
1630. Arithmetic Subarrays | Link | Link |
1641. Count Sorted Vowel Strings | Link | Link |
1669. Merge In Between Linked Lists | Link | Link |
1670. Design Front Middle Back Queue | Link | Link |
1679. Max Number of K-Sum Pairs | Link | Link |
1685. Sum of Absolute Differences in a Sorted Array | Link | Link |
1706. Where Will the Ball Fall | Link | Link |
1721. Swapping Nodes in a Linked List | Link | Link |
1770. Maximum Score from Performing Multiplication Operations | Link | Link |
1780. Check if Number is a Sum of Powers of Three | Link | Link |
1797. Design Authentication Manager | Link | Link |
1814. Count Nice Pairs in an Array | Link | Link |
1823. Find the Winner of the Circular Game | Link | Link |
1829. Maximum XOR for Each Query | Link | Link |
1834. Single-Threaded CPU | Link | Link |
1845. Seat Reservation Manager | Link | Link |
1877. Minimize Maximum Pair Sum in Array | Link | Link |
1910. Remove All Occurrences of a Substring | Link | Link |
1985. Find the Kth Largest Integer in the Array | Link | Link |
1996. The Number of Weak Characters in the Game | Link | Link |
2007. Find Original Array From Doubled Array | Link | Link |
2023. Number of Pairs of Strings With Concatenation Equal to Target | Link | Link |
2058. Find the Minimum and Maximum Number of Nodes Between Critical Points | Link | Link |
2063. Vowels of All Substrings | Link | Link |
2074. Reverse Nodes in Even Length Groups | Link | Link |
2091. Removing Minimum and Maximum From Array | Link | Link |
2095. Delete the Middle Node of a Linked List | Link | Link |
2096. Step-By-Step Directions From a Binary Tree Node to Another | Link | Link |
2109. Adding Spaces to a String | Link | Link |
2121. Intervals Between Identical Elements | Link | Link |
2125. Number of Laser Beams in a Bank | Link | Link |
2130. Maximum Twin Sum of a Linked List | Link | Link |
2131. Longest Palindrome by Concatenating Two Letter Words | Link | Link |
2149. Rearrange Array Elements by Sign | Link | Link |
2150. Find All Lonely Numbers in the Array | Link | Link |
2161. Partition Array According to Given Pivot | Link | Link |
2165. Smallest Value of the Rearranged Number | Link | Link |
2177. Find Three Consecutive Integers That Sum to a Given Number | Link | Link |
2181. Merge Nodes in Between Zeros | Link | Link |
2196. Create Binary Tree From Descriptions | Link | Link |
2221. Find Triangular Sum of an Array | Link | Link |
2225. Find Players With Zero or One Losses | Link | Link |
2233. Maximum Product After K Increments | Link | Link |
2265. Count Nodes Equal to Average of Subtree | Link | Link |
2266. Count Number of Texts | Link | Link |
2295. Replace Elements in an Array | Link | Link |
2326. Spiral Matrix IV | Link | Link |
2375. Construct Smallest Number From DI String | Link | Link |
2390. Removing Stars From a String | Link | Link |
2415. Reverse Odd Levels of Binary Tree | Link | Link |
2487. Remove Nodes From Linked List | Link | Link |
Name | Link to LeetCode | Link to solution |
---|---|---|
4. Median of Two Sorted Arrays | Link | Link |
10. Regular Expression Matching | Link | Link |
23. Merge k Sorted Lists | Link | Link |
25. Reverse Nodes in k-Group | Link | Link |
30. Substring with Concatenation of All Words | Link | Link |
32. Longest Valid Parentheses | Link | Link |
41. First Missing Positive | Link | Link |
115. Distinct Subsequences | Link | Link |
126. Word Ladder II | Link | Link |
233. Number of Digit One | Link | Link |
239. Sliding Window Maximum | Link | Link |
297. Serialize and Deserialize Binary Tree | Link | Link |
336. Palindrome Pairs | Link | Link |
363. Max Sum of Rectangle No Larger Than K | Link | Link |
458. Poor Pigs | Link | Link |
871. Minimum Number of Refueling Stops | Link | Link |
895. Maximum Frequency Stack | Link | Link |
936. Stamping The Sequence | Link | Link |
968. Binary Tree Cameras | Link | Link |
1106. Parsing A Boolean Expression | Link | Link |
1220. Count Vowels Permutation | Link | Link |
1944. Number of Visible People in a Queue | Link | Link |