/hj-leetcode-kotlin

My kotlin solutions to LeetCode problems.

Primary LanguageKotlinApache License 2.0Apache-2.0

hj-leetcode-kotlin

Solving LeetCode is fun! This repository records my kotlin solution to solved problems. You can also visit me at LeetCode.

Solutions

Hard

Problem Solution Last Modified
23. Merge k Sorted Lists Solution, Solution2 2023-03-12
41. First Missing Positive Solution 2024-03-26
42. Trapping Rain Water Solution, Solution2 2024-04-14
72. Edit Distance Solution 2023-02-26
76. Minimum Window Substring Solution 2024-02-04
87. Scramble String Solution 2023-03-30
124. Binary Tree Maximum Path Sum Solution 2022-12-12
140. Word Break II Solution 2024-05-25
214. Shortest Palindrome Solution 2024-09-20
218. The Skyline Problem Solution 2022-10-01
224. Basic Calculator Solution 2022-11-21
273. Integer to English Words Solution 2024-08-07
295. Find Median from Data Stream Solution 2022-11-12
330. Patching Array Solution 2024-06-17
336. Palindrome Pairs Solution 2022-09-20
403. Frog Jump Solution 2023-08-27
407. Trapping Rain Water II Solution, Solution2 2025-01-19
432. All O`one Data Structure Solution 2024-09-29
440. K-th Smallest in Lexicographical Order Solution 2024-09-22
446. Arithmetic Slices II - Subsequence Solution 2024-01-07
460. LFU Cache Solution 2023-02-20
502. IPO Solution 2024-06-15
552. Student Attendance Record II Solution 2024-05-26
629. K Inverse Pairs Array Solution 2024-01-28
632. Smallest Range Covering Elements from K Lists Solution, Solution2 2024-10-13
689. Maximum Sum of 3 Non-Overlapping Subarrays Solution, Solution2 2024-12-28
719. Find K-th Smallest Pair Distance Solution, Solution2 2024-08-14
732. My Calendar III Solution 2022-10-07
773. Sliding Puzzle Solution 2024-11-25
827. Making A Large Island Solution 2025-01-31
834. Sum of Distances in Tree Solution 2024-04-28
857. Minimum Cost to Hire K Workers Solution 2024-05-11
862. Shortest Subarray with Sum at Least K Solution 2024-11-17
992. Subarrays with K Different Integers Solution 2024-03-30
995. Minimum Number of K Consecutive Bit Flips Solution, Solution2 2024-06-25
1028. Recover a Tree From Preorder Traversal Solution, Solution2 2025-02-22
1092. Shortest Common Supersequence Solution 2025-02-28
1106. Parsing A Boolean Expression Solution, Solution2 2024-10-20
1074. Number of Submatrices That Sum to Target Solution 2024-01-28
1220. Count Vowels Permutation Solution 2023-10-29
1235. Maximum Profit in Job Scheduling Solution 2024-01-06
1269. Number of Ways to Stay in the Same Place After Some Steps Solution, Solution2 2023-10-15
1293. Shortest Path in a Grid with Obstacles Elimination Solution 2022-11-01
1335. Minimum Difficulty of a Job Schedule Solution 2023-12-29
1345. Jump Game IV Solution 2023-03-05
1359. Count All Valid Pickup and Delivery Options Solution 2023-09-10
1368. Minimum Cost to Make at Least One Valid Path in a Grid Solution 2025-01-18
1383. Maximum Performance of a Team Solution 2022-09-23
1402. Reducing Dishes Solution, Solution2 2023-03-29
1406. Stone Game III Solution 2023-05-30
1444. Number of Ways of Cutting a Pizza Solution 2023-03-31
1489. Find Critical and Pseudo-Critical Edges in Minimum Spanning Tree Solution 2023-08-20
1568. Minimum Number of Days to Disconnect Island Solution 2024-08-11
1601. Maximum Number of Achievable Transfer Requests Solution 2023-07-02
1639. Number of Ways to Form a Target String Given a Dictionary Solution 2024-12-29
1671. Minimum Number of Removals to Make Mountain Array Solution 2024-10-30
1675. Minimize Deviation in Array Solution 2023-02-25
2033. Minimum Operations to Make a Uni-Value Grid Solution 2025-03-26
2045. Second Minimum Time to Reach Destination Solution 2024-07-28
2050. Parallel Courses III Solution 2023-10-19
2092. Find All People With Secret Solution 2024-02-24
2097. Valid Arrangement of Pairs Solution, Solution2 2024-11-30
2127. Maximum Employees to Be Invited to a Meeting Solution 2025-01-26
2136. Earliest Possible Day of Full Bloom Solution 2022-10-29
2251. Number of Flowers in Full Bloom Solution 2023-10-11
2290. Minimum Obstacle Removal to Reach Corner Solution 2024-11-28
2306. Naming a Company Solution, Solution2 2023-02-09
2360. Longest Cycle in a Graph Solution 2023-03-26
2392. Build a Matrix With Conditions Solution 2024-07-21
2416. Sum of Prefix Scores of Strings Solution 2024-09-25
2444. Count Subarrays With Fixed Bounds Solution 2024-03-31
2458. Height of Binary Tree After Subtree Removal Queries Solution 2024-10-26
2463. Minimum Total Distance Traveled Solution, Solution2 2024-11-01
2493. Divide Nodes Into the Maximum Number of Groups Solution 2025-01-31
2503. Maximum Number of Points From Grid Queries Solution 2025-03-28
2577. Minimum Time to Visit a Cell In a Grid Solution 2024-11-29
2699. Modify Graph Edge Weights Solution 2024-08-31
2751. Robot Collisions Solution 2024-07-13
2780. Minimum Index of a Valid Split Solution 2025-03-27
2818. Apply Operations to Maximize Score Solution, Solution2 2025-03-29
2872. Maximum Number of K-Divisible Components Solution 2024-12-21
2940. Find Building Where Alice and Bob Can Meet Solution, Solution2 2024-12-22
3068. Find the Maximum Sum of Node Values Solution 2024-05-19
3108. Minimum Cost Walk in Weighted Graph Solution 2025-03-20
3203. Find Minimum Diameter After Merging Two Trees Solution 2024-12-24

Medium

Problem Solution Last Modified
5. Longest Palindromic Substring Solution, Solution2 2023-10-28
6. Zigzag Conversion Solution, Solution2 2023-02-03
7. Reverse Integer Solution 2022-09-23
11. Container With Most Water Solution 2022-09-17
12. Integer to Roman Solution 2022-10-16
15. 3Sum Solution 2022-09-13
16. 3Sum Closest Solution 2022-09-24
17. Letter Combinations of a Phone Number Solution 2023-08-04
18. 4Sum Solution 2022-10-19
19. Remove Nth Node From End of List Solution, Solution2 2024-03-03
24. Swap Nodes in Pairs Solution 2023-05-16
28. Find the Index of the First Occurrence in a String Solution 2023-03-05
31. Next Permutation Solution 2022-09-24
33. Search in Rotated Sorted Array Solution 2023-08-08
34. Find First and Last Position of Element in Sorted Array Solution 2023-10-09
36. Valid Sudoku Solution 2022-11-23
38. Count and Say Solution 2022-10-18
45. Jump Game II Solution, Solution2 2023-02-08
46. Permutations Solution, Solution2 2023-08-02
47. Permutations II Solution 2022-09-21
49. Group Anagrams Solution 2024-02-06
50. Pow(x, n) Solution 2023-07-24
54. Spiral Matrix Solution 2023-05-10
55. Jump Game Solution, Solution2 2022-12-26
57. Insert Interval Solution 2024-03-17
59. Spiral Matrix II Solution 2023-05-10
61. Rotate List Solution 2022-09-28
62. Unique Paths Solution 2023-09-03
63. Unique Paths II Solution 2023-08-12
64. Minimum Path Sum Solution 2023-03-27
71. Simplify Path Solution 2023-04-12
74. Search a 2D Matrix Solution 2023-08-07
75. Sort Colors Solution, Solution2 2024-06-12
78. Subsets Solution, Solution2 2024-05-21
79. Word Search Solution 2024-04-03
81. Search in Rotated Sorted Array II Solution 2023-08-10
86. Partition List Solution 2023-08-15
90. Subsets II Solution 2022-10-10
91. Decode Ways Solution 2023-12-25
92. Reverse Linked List II Solution, Solution2 2023-10-09
97. Interleaving String Solution 2023-08-25
103. Binary Tree Zigzag Level Order Traversal Solution, Solution2 2023-02-19
106. Construct Binary Tree from Inorder and Postorder Traversal Solution 2023-03-16
109. Convert Sorted List to Binary Search Tree Solution, Solution2 2023-03-11
113. Path Sum II Solution 2022-09-24
129. Sum Root to Leaf Numbers Solution, Solution2 2024-04-15
131. Palindrome Partitioning Solution 2024-05-22
133. Clone Graph Solution, Solution2 2023-04-08
134. Gas Station Solution 2023-01-11
137. Single Number II Solution, Solution2 2023-07-04
138. Copy List with Random Pointer Solution 2023-09-05
139. Word Break Solution 2023-08-04
142. Linked List Cycle II Solution, Solution2 2023-03-09
143. Reorder List Solution 2024-04-23
148. Sort List Solution, Solution2 2022-10-01
150. Evaluate Reverse Polish Notation Solution 2024-01-30
151. Reverse Words in a String Solution 2022-11-14
162. Find Peak Element Solution 2022-10-13
165. Compare Version Numbers Solution 2024-05-03
167. Two Sum II - Input Array Is Sorted Solution 2022-10-13
179. Largest Number Solution 2024-09-18
189. Rotate Array Solution, Solution2 2022-09-25
198. House Robber Solution 2022-12-14
200. Number of Islands Solution 2024-04-19
201. Bitwise AND of Numbers Range Solution 2024-02-21
207. Course Schedule Solution 2023-07-14
208. Implement Trie (Prefix Tree) Solution 2023-03-17
209. Minimum Size Subarray Sum Solution 2023-07-06
210. Course Schedule II Solution 2022-09-19
211. Design Add and Search Words Data Structure Solution 2023-03-19
215. Kth Largest Element in an Array Solution 2023-08-14
221. Maximal Square Solution 2022-10-18
222. Count Complete Tree Nodes Solution 2022-11-15
223. Rectangle Area Solution 2022-11-18
229. Majority Element II Solution 2022-10-10
230. Kth Smallest Element in a BST Solution 2022-09-26
237. Delete Node in a Linked List Solution 2022-10-13
238. Product of Array Except Self Solution 2024-03-15
241. Different Ways to Add Parentheses Solution 2024-09-21
260. Single Number III Solution 2024-05-31
264. Ugly Number II Solution, Solution2 2024-08-19
279. Perfect Squares Solution, Solution2 2024-02-08
287. Find the Duplicate Number Solution, Solution2 2024-03-24
300. Longest Increasing Subsequence Solution 2024-01-05
319. Bulb Switcher Solution 2023-04-27
328. Odd Even Linked List Solution 2022-12-06
334. Increasing Triplet Subsequence Solution 2022-10-11
341. Flatten Nested List Iterator Solution 2023-10-21
343. Integer Break Solution 2023-10-06
347. Top K Frequent Elements Solution 2023-05-22
368. Largest Divisible Subset Solution 2024-02-09
373. Find K Pairs with Smallest Sums Solution 2023-06-27
380. Insert Delete GetRandom O(1) Solution, Solution2 2024-01-16
382. Linked List Random Node Solution 2023-03-10
386. Lexicographical Numbers Solution 2024-09-21
393. UTF-8 Validation Solution 2022-09-13
399. Evaluate Division Solution 2023-12-22
402. Remove K Digits Solution 2024-04-11
427. Construct Quad Tree Solution 2023-02-27
433. Minimum Genetic Mutation Solution 2022-11-03
435. Non-overlapping Intervals Solution, Solution2 2023-12-24
438. Find All Anagrams in a String Solution 2023-02-05
442. Find All Duplicates in an Array Solution 2024-03-25
443. String Compression Solution 2023-03-02
445. Add Two Numbers II Solution 2023-07-18
451. Sort Characters By Frequency Solution 2024-02-07
452. Minimum Number of Arrows to Burst Balloons Solution, Solution2 2024-03-18
486. Predict the Winner Solution 2023-07-29
494. Target Sum Solution, Solution2 2024-12-26
513. Find Bottom Left Tree Value Solution 2024-03-02
515. Find Largest Value in Each Tree Row Solution 2023-10-24
516. Longest Palindromic Subsequence Solution 2023-04-14
518. Coin Change II Solution 2023-08-11
523. Continuous Subarray Sum Solution 2024-06-08
525. Contiguous Array Solution 2024-03-16
539. Minimum Time Difference Solution 2024-09-16
540. Single Element in a Sorted Array Solution, Solution2 2023-02-21
542. 01 Matrix Solution 2023-08-17
547. Number of Provinces Solution 2023-06-04
567. Permutation in String Solution 2024-10-05
592. Fraction Addition and Subtraction Solution 2024-08-23
609. Find Duplicate File in System Solution 2022-09-19
622. Design Circular Queue Solution 2022-09-25
623. Add One Row to Tree Solution, Solution2 2024-04-16
624. Maximum Distance in Arrays Solution, Solution2 2024-08-17
633. Sum of Square Numbers Solution 2024-06-17
636. Exclusive Time of Functions Solution 2022-10-06
640. Solve the Equation Solution 2022-10-07
641. Design Circular Deque Solution 2024-09-28
646. Maximum Length of Pair Chain Solution 2023-08-26
647. Palindromic Substrings Solution, Solution2 2024-02-10
648. Replace Words Solution, Solution2 2024-06-08
652. Find Duplicate Subtrees Solution 2023-02-28
655. Print Binary Tree Solution 2022-10-11
658. Find K Closest Elements Solution 2022-09-29
662. Maximum Width of Binary Tree Solution 2023-04-20
670. Maximum Swap Solution 2024-10-17
673. Number of Longest Increasing Subsequence Solution 2023-12-31
684. Redundant Connection Solution 2025-01-29
688. Knight Probability in Chessboard Solution 2023-07-22
692. Top K Frequent Words Solution 2022-10-19
712. Minimum ASCII Delete Sum for Two Strings Solution 2023-08-01
713. Subarray Product Less Than K Solution 2024-03-27
718. Maximum Length of Repeated Subarray Solution 2022-09-20
725. Split Linked List in Parts Solution 2024-09-08
729. My Calendar I Solution 2024-09-26
731. My Calendar II Solution 2024-09-28
735. Asteroid Collision Solution 2023-12-23
739. Daily Temperatures Solution 2024-02-01
752. Open the Lock Solution 2024-04-22
769. Max Chunks To Make Sorted Solution 2024-12-19
779. K-th Symbol in Grammar Solution 2023-10-25
785. Is Graph Bipartite? Solution 2023-05-19
786. K-th Smallest Prime Fraction Solution, Solution2 2024-05-11
787. Cheapest Flights Within K Stops Solution 2024-02-24
790. Domino and Tromino Tiling Solution 2022-12-28
791. Custom Sort String Solution 2024-03-11
797. All Paths From Source to Target Solution 2023-01-02
799. Champagne Tower Solution 2023-09-24
802. Find Eventual Safe States Solution, Solution2 2025-01-24
808. Soup Servings Solution 2023-07-30
835. Image Overlap Solution 2022-10-28
838. Push Dominoes Solution 2022-09-27
840. Magic Squares In Grid Solution 2024-08-09
841. Keys and Rooms Solution 2022-12-22
848. Shifting Letters Solution 2022-09-27
852. Peak Index in a Mountain Array Solution 2023-07-25
861. Score After Flipping Matrix Solution 2024-05-13
863. All Nodes Distance K in Binary Tree Solution 2023-07-11
873. Length of Longest Fibonacci Subsequence Solution 2025-02-27
874. Walking Robot Simulation Solution 2024-09-04
875. Koko Eating Bananas Solution 2023-03-08
880. Decoded String at Index Solution 2023-09-27
881. Boats to Save People Solution 2024-05-04
885. Spiral Matrix III Solution 2024-08-08
886. Possible Bipartition Solution 2022-12-22
889. Construct Binary Tree from Preorder and Postorder Traversal Solution, Solution2 2025-02-23
901. Online Stock Span Solution 2022-11-10
904. Fruit Into Baskets Solution 2023-02-07
907. Sum of Subarray Minimums Solution 2022-12-01
912. Sort an Array Solution 2023-03-01
916. Word Subsets Solution 2025-01-10
921. Minimum Add to Make Parentheses Valid Solution 2024-10-09
926. Flip String to Monotone Increasing Solution 2023-01-17
931. Minimum Falling Path Sum Solution 2024-01-19
934. Shortest Bridge Solution 2023-05-23
946. Validate Stack Sequences Solution 2023-04-13
947. Most Stones Removed with Same Row or Column Solution, Solution2 2024-08-29
948. Bag of Tokens Solution 2024-03-04
950. Reveal Cards In Increasing Order Solution 2024-04-10
951. Flip Equivalent Binary Trees Solution 2024-10-24
962. Maximum Width Ramp Solution 2024-10-10
974. Subarray Sums Divisible by K Solution 2024-06-09
979. Distribute Coins in Binary Tree Solution 2024-05-18
981. Time Based Key-Value Store Solution 2022-10-06
983. Minimum Cost For Tickets Solution 2024-12-31
985. Sum of Even Numbers After Queries Solution 2022-09-21
990. Satisfiability of Equality Equations Solution 2022-09-27
1011. Capacity To Ship Packages Within D Days Solution 2023-02-22
1014. Best Sightseeing Pair Solution 2024-12-27
1020. Number of Enclaves Solution 2023-04-08
1026. Maximum Difference Between Node and Ancestor Solution 2024-01-11
1027. Longest Arithmetic Subsequence Solution 2023-06-24
1038. Binary Search Tree to Greater Sum Tree Solution 2024-06-26
1043. Partition Array for Maximum Sum Solution 2024-02-03
1052. Grumpy Bookstore Owner Solution 2024-06-21
1061. Lexicographically Smallest Equivalent String Solution 2023-01-14
1072. Flip Columns For Maximum Number of Equal Rows Solution 2024-11-22
1079. Letter Tile Possibilities Solution, Solution2 2025-02-18
1105. Filling Bookcase Shelves Solution 2024-07-31
1110. Delete Nodes And Return Forest Solution, Solution2 2024-07-17
1129. Shortest Path with Alternating Colors Solution 2023-02-11
1140. Stone Game II Solution 2024-08-20
1143. Longest Common Subsequence Solution 2024-01-26
1146. Snapshot Array Solution 2023-06-11
1155. Number of Dice Rolls With Target Sum Solution 2023-12-26
1161. Maximum Level Sum of a Binary Tree Solution 2023-06-15
1162. As Far from Land as Possible Solution 2023-02-10
1171. Remove Zero Sum Consecutive Nodes from Linked List Solution 2024-03-12
1190. Reverse Substrings Between Each Pair of Parentheses Solution 2024-09-28
1201. Ugly Number III Solution 2022-09-13
1208. Get Equal Substrings Within Budget Solution 2024-05-28
1218. Longest Arithmetic Subsequence of Given Difference Solution 2023-07-14
1219. Path with Maximum Gold Solution 2024-05-14
1233. Remove Sub-Folders from the Filesystem Solution 2024-10-25
1234. Replace the Substring for Balanced String Solution 2022-09-20
1239. Maximum Length of a Concatenated String with Unique Characters Solution 2022-10-28
1248. Count Number of Nice Subarrays Solution, Solution2 2024-06-22
1254. Number of Closed Islands Solution 2023-04-07
1261. Find Elements in a Contaminated Binary Tree Solution 2025-02-21
1267. Count Servers that Communicate Solution, Solution2 2025-01-23
1277. Count Square Submatrices with All Ones Solution 2024-10-27
1282. Group the People Given the Group Size They Belong To Solution 2023-09-11
1291. Sequential Digits Solution 2024-02-02
1296. Divide Array in Sets of K Consecutive Numbers Solution, Solution2 2022-10-05
1310. XOR Queries of a Subarray Solution 2024-09-13
1318. Minimum Flips to Make a OR b Equal to c Solution 2023-06-07
1319. Number of Operations to Make Network Connected Solution, Solution2 2023-03-25
1325. Delete Leaves With a Given Value Solution 2024-05-17
1328. Break a Palindrome Solution 2022-10-10
1334. Find the City With the Smallest Number of Neighbors at a Threshold Distance Solution 2024-07-26
1339. Maximum Product of Splitted Binary Tree Solution 2022-12-10
1347. Minimum Number of Steps to Make Two Strings Anagram Solution 2024-01-13
1352. Product of the Last K Numbers Solution 2025-02-15
1358. Number of Substrings Containing All Three Characters Solution 2025-03-11
1361. Validate Binary Tree Nodes Solution 2023-10-17
1367. Linked List in Binary Tree Solution 2024-09-07
1371. Find the Longest Substring Containing Vowels in Even Counts Solution 2024-09-15
1372. Longest ZigZag Path in a Binary Tree Solution 2023-04-24
1376. Time Needed to Inform All Employees Solution 2023-06-03
1381. Design a Stack With Increment Operation Solution 2024-09-30
1382. Balance a Binary Search Tree Solution 2024-06-26
1395. Count Number of Teams Solution, Solution2 2024-07-29
1396. Design Underground System Solution 2023-06-02
1400. Construct K Palindrome Strings Solution 2025-01-11
1401. Circle and Rectangle Overlapping Solution 2022-10-04
1404. Number of Steps to Reduce a Number in Binary Representation to One Solution 2024-05-29
1405. Longest Happy String Solution 2024-10-16
1415. The k-th Lexicographical String of All Happy Strings of Length n Solution 2025-02-19
1424. Diagonal Traverse II Solution 2023-11-22
1442. Count Triplets That Can Form Two Arrays of Equal XOR Solution 2024-05-30
1456. Maximum Number of Vowels in a Substring of Given Length Solution 2023-05-05
1457. Pseudo-Palindromic Paths in a Binary Tree Solution 2024-01-24
1462. Course Schedule IV Solution 2025-01-27
1466. Reorder Routes to Make All Paths Lead to the City Zero Solution 2023-03-24
1472. Design Browser History Solution, Solution2 2023-03-18
1482. Minimum Number of Days to Make m Bouquets Solution, Solution2 2024-06-19
1493. Longest Subarray of 1's After Deleting One Element Solution 2023-07-05
1497. Check If Array Pairs Are Divisible by k Solution, Solution2 2024-10-01
1498. Number of Subsequences That Satisfy the Given Sum Condition Solution 2023-05-06
1503. Last Moment Before All Ants Fall Out of a Plank Solution 2023-11-04
1509. Minimum Difference Between Largest and Smallest Value in Three Moves Solution 2024-07-03
1514. Path with Maximum Probability Solution 2024-08-31
1524. Number of Sub-arrays With Odd Sum Solution 2025-02-25
1545. Find Kth Bit in Nth Binary String Solution, Solution2 2024-10-19
1552. Magnetic Force Between Two Balls Solution 2024-06-20
1557. Minimum Number of Vertices to Reach All Nodes Solution 2023-05-18
1561. Maximum Number of Coins You Can Get Solution 2023-11-24
1574. Shortest Subarray to be Removed to Make Array Sorted Solution 2024-11-15
1578. Minimum Time to Make Rope Colorful Solution 2023-12-27
1590. Make Sum Divisible by P Solution 2024-10-03
1593. Split a String Into the Max Number of Unique Substrings Solution 2024-10-21
1605. Find Valid Matrix Given Row and Column Sums Solution 2024-07-20
1609. Even Odd Tree Solution 2024-02-29
1615. Maximal Network Rank Solution 2023-08-18
1626. Best Team With No Conflicts Solution 2023-01-31
1637. Widest Vertical Area Between Two Points Containing No Points Solution 2023-12-21
1653. Minimum Deletions to Make String Balanced Solution, Solution2 2024-07-30
1657. Determine if Two Strings Are Close Solution 2024-01-14
1669. Merge In Between Linked Lists Solution 2024-03-20
1680. Concatenation of Consecutive Binary Numbers Solution, Solution2 2022-09-25
1685. Sum of Absolute Differences in a Sorted Array Solution 2023-11-25
1696. Jump Game VI Solution 2022-09-21
1706. Where Will the Ball Fall Solution 2022-11-01
1718. Construct the Lexicographically Largest Valid Sequence Solution 2025-02-16
1721. Swapping Nodes in a Linked List Solution 2023-05-15
1726. Tuple with Same Product Solution 2025-02-06
1749. Maximum Absolute Sum of Any Subarray Solution 2025-02-26
1750. Minimum Length of String After Deleting Similar Ends Solution 2024-03-05
1759. Count Number of Homogenous Substrings Solution 2023-11-09
1760. Minimum Limit of Balls in a Bag Solution 2024-12-07
1765. Map of Highest Peak Solution 2025-01-22
1769. Minimum Number of Operations to Move All Balls to Each Box Solution 2025-01-06
1770. Maximum Score from Performing Multiplication Operations Solution 2022-09-16
1780. Check if Number is a Sum of Powers of Three Solution 2025-03-04
1792. Maximum Average Pass Ratio Solution 2024-12-15
1802. Maximum Value at a Given Index in a Bounded Array Solution 2023-06-11
1813. Sentence Similarity III Solution, Solution2 2024-10-07
1814. Count Nice Pairs in an Array Solution 2023-11-21
1823. Find the Winner of the Circular Game Solution, Solution2 2024-07-08
1829. Maximum XOR for Each Query Solution 2024-11-08
1833. Maximum Ice Cream Bars Solution 2023-01-06
1834. Single-Threaded CPU Solution 2023-01-02
1838. Frequency of the Most Frequent Element Solution 2024-12-06
1861. Rotating the Box Solution 2024-11-23
1870. Minimum Speed to Arrive on Time Solution 2023-07-26
1894. Find the Student that Will Replace the Chalk Solution 2024-09-02
1905. Count Sub Islands Solution 2024-08-28
1910. Remove All Occurrences of a Substring Solution 2025-02-11
1915. Number of Wonderful Substrings Solution 2024-04-30
1926. Nearest Exit from Entrance in Maze Solution 2022-11-21
1930. Unique Length-3 Palindromic Subsequences Solution 2025-01-04
1937. Maximum Number of Points with Cost Solution 2024-08-18
1942. The Number of the Smallest Unoccupied Chair Solution 2024-10-11
1962. Remove Stones to Minimize the Total Solution 2022-12-28
1963. Minimum Number of Swaps to Make the String Balanced Solution 2024-10-08
1975. Maximum Matrix Sum Solution 2024-11-24
1976. Number of Ways to Arrive at Destination Solution 2025-03-23
1980. Find Unique Binary String Solution, Solution2 2025-02-20
1992. Find All Groups of Farmland Solution 2024-04-20
1996. The Number of Weak Characters in the Game Solution 2022-09-09
2007. Find Original Array From Doubled Array Solution, Solution2 2022-09-15
2017. Grid Game Solution 2025-01-21
2024. Maximize the Confusion of an Exam Solution 2023-07-07
2028. Find Missing Observations Solution 2024-09-05
2038. Remove Colored Pieces if Both Neighbors are the Same Color Solution 2023-10-02
2044. Count Number of Maximum Bitwise-OR Subsets Solution 2024-10-18
2054. Two Best Non-Overlapping Events Solution 2024-12-08
2064. Minimized Maximum of Products Distributed to Any Store Solution, Solution2 2024-11-14
2070. Most Beautiful Item for Each Query Solution 2024-11-12
2090. K Radius Subarray Averages Solution 2023-06-20
2095. Delete the Middle Node of a Linked List Solution 2022-10-14
2096. Step-By-Step Directions From a Binary Tree Node to Another Solution 2024-07-16
2101. Detonate the Maximum Bombs Solution 2023-06-02
2109. Adding Spaces to a String Solution 2024-12-03
2115. Find All Possible Recipes from Given Supplies Solution 2025-03-21
2116. Check if a Parentheses String Can Be Valid Solution 2025-01-12
2125. Number of Laser Beams in a Bank Solution 2024-01-03
2130. Maximum Twin Sum of a Linked List Solution 2023-05-17
2131. Longest Palindrome by Concatenating Two Letter Words Solution 2022-11-04
2134. Minimum Swaps to Group All 1's Together II Solution 2024-08-02
2149. Rearrange Array Elements by Sign Solution 2024-02-14
2161. Partition Array According to Given Pivot Solution 2025-03-03
2181. Merge Nodes in Between Zeros Solution 2024-07-04
2182. Construct String With Repeat Limit Solution 2024-12-17
2187. Minimum Time to Complete Trips Solution 2023-03-07
2191. Sort the Jumbled Numbers Solution 2024-07-24
2192. All Ancestors of a Node in a Directed Acyclic Graph Solution, Solution2 2024-06-30
2196. Create Binary Tree From Descriptions Solution 2024-07-15
2225. Find Players With Zero or One Losses Solution 2024-01-15
2226. Maximum Candies Allocated to K Children Solution 2025-03-14
2244. Minimum Rounds to Complete All Tasks Solution 2023-01-04
2256. Minimum Average Difference Solution 2022-12-04
2257. Count Unguarded Cells in the Grid Solution 2024-11-21
2270. Number of Ways to Split Array Solution 2025-01-03
2275. Largest Combination With Bitwise AND Greater Than Zero Solution 2024-11-07
2279. Maximum Bags With Full Capacity of Rocks Solution 2022-12-27
2285. Maximum Total Importance of Roads Solution 2024-06-28
2300. Successful Pairs of Spells and Potions Solution 2023-04-02
2305. Fair Distribution of Cookies Solution 2023-07-02
2316. Count Unreachable Pairs of Nodes in an Undirected Graph Solution, Solution2 2023-03-25
2326. Spiral Matrix IV Solution 2024-09-09
2336. Smallest Number in Infinite Set Solution 2023-04-26
2337. Move Pieces to Obtain a String Solution 2024-12-05
2342. Max Sum of a Pair With Equal Sum of Digits Solution 2025-02-12
2348. Number of Zero-Filled Subarrays Solution, Solution2 2023-03-21
2349. Design a Number Container System Solution 2025-02-08
2352. Equal Row and Column Pairs Solution 2023-06-13
2353. Design a Food Rating System Solution 2023-12-17
2364. Count Number of Bad Pairs Solution 2025-02-09
2369. Check if There is a Valid Partition For The Array Solution 2023-08-13
2375. Construct Smallest Number From DI String Solution 2025-02-18
2381. Shifting Letters II Solution 2025-01-05
2390. Removing Stars From a String Solution 2023-04-11
2391. Minimum Amount of Time to Collect Garbage Solution 2023-11-20
2401. Longest Nice Subarray Solution 2025-03-18
2405. Optimal Partition of String Solution 2023-04-04
2415. Reverse Odd Levels of Binary Tree Solution, Solution2 2024-12-20
2425. Bitwise XOR of All Pairings Solution 2025-01-16
2429. Minimize XOR Solution 2025-01-15
2433. Find The Original Array of Prefix Xor Solution 2023-10-31
2439. Minimize Maximum of Array Solution 2023-04-06
2461. Maximum Sum of Distinct Subarrays With Length K Solution 2024-11-19
2466. Count Ways To Build Good Strings Solution 2024-12-30
2467. Most Profitable Path in a Tree Solution 2025-02-24
2471. Minimum Number of Operations to Sort a Binary Tree by Level Solution 2024-12-23
2477. Minimum Fuel Cost to Report to the Capital Solution 2023-02-12
2482. Difference Between Ones and Zeros in Row and Column Solution 2023-12-14
2483. Minimum Penalty for a Shop Solution, Solution2 2023-08-29
2486. Append Characters to String to Make Subsequence Solution 2024-06-03
2487. Remove Nodes From Linked List Solution, Solution2 2024-05-07
2491. Divide Players Into Teams of Equal Skill Solution 2024-10-04
2492. Minimum Score of a Path Between Two Cities Solution, Solution2 2023-03-22
2501. Longest Square Streak in an Array Solution 2024-10-28
2516. Take K of Each Character From Left and Right Solution, Solution2 2024-11-20
2523. Closest Prime Numbers in Range Solution 2025-03-07
2530. Maximal Score After Applying K Operations Solution 2024-10-14
2554. Maximum Number of Integers to Choose From a Range I Solution 2024-12-06
2558. Take Gifts From the Richest Pile Solution 2024-12-12
2559. Count Vowel Strings in Ranges Solution 2025-01-02
2560. House Robber IV Solution 2025-03-15
2563. Count the Number of Fair Pairs Solution 2024-11-13
2579. Count Total Number of Colored Cells Solution 2025-03-05
2583. Kth Largest Sum in a Binary Tree Solution 2024-10-24
2593. Find Score of an Array After Marking All Elements Solution 2024-12-13
2594. Minimum Time to Repair Cars Solution 2025-03-16
2601. Prime Subtraction Operation Solution 2024-11-11
2610. Convert an Array Into a 2D Array With Conditions Solution 2024-01-02
2616. Minimize the Maximum Difference of Pairs Solution 2023-08-09
2641. Cousins in Binary Tree II Solution 2024-10-23
2657. Find the Prefix Common Array of Two Arrays Solution 2025-01-14
2658. Maximum Number of Fish in a Grid Solution 2025-01-28
2661. First Completely Painted Row or Column Solution, Solution2 2025-01-20
2683. Neighboring Bitwise XOR Solution 2025-01-17
2684. Maximum Number of Moves in a Grid Solution 2024-10-30
2685. Count the Number of Complete Components Solution 2025-03-22
2698. Find the Punishment Number of an Integer Solution 2025-02-15
2707. Extra Characters in a String Solution 2024-09-23
2762. Continuous Subarrays Solution, Solution2 2024-12-14
2779. Maximum Beauty of an Array After Applying Operation Solution 2024-12-11
2785. Sort Vowels in a String Solution 2023-11-13
2807. Insert Greatest Common Divisors in Linked List Solution 2024-09-10
2816. Double a Number Represented as a Linked List Solution 2024-05-07
2825. Make String a Subsequence Using Cyclic Increments Solution 2024-12-04
2849. Determine if a Cell Is Reachable at a Given Time Solution 2023-11-08
2870. Minimum Number of Operations to Make Array Empty Solution 2024-01-04
2914. Minimum Number of Changes to Make Binary String Beautiful Solution 2024-11-05
2924. Find Champion II Solution, Solution2 2024-11-26
2938. Separate Black and White Balls Solution 2024-10-15
2948. Make Lexicographically Smallest Array by Swapping Elements Solution 2025-01-25
2958. Length of Longest Subarray With at Most K Frequency Solution 2024-03-28
2962. Count Subarrays Where Max Element Appears at Least K Times Solution 2024-03-29
2966. Divide Array Into Arrays With Max Difference Solution 2024-02-01
2971. Find Polygon With the Largest Perimeter Solution 2024-02-15
2976. Minimum Cost to Convert String I Solution 2024-07-27
2981. Find Longest Special Substring That Occurs Thrice I Solution 2024-12-10
2997. Minimum Number of Operations to Make Array XOR Equal to K Solution 2024-04-29
3011. Find if Array Can Be Sorted Solution 2024-11-06
3016. Minimum Number of Pushes to Type Word II Solution 2024-08-06
3043. Find the Length of the Longest Common Prefix Solution 2024-09-24
3066. Minimum Operations to Exceed Threshold Value II Solution, Solution2 2025-02-13
3075. Maximize Happiness of Selected Children Solution 2024-05-09
3097. Shortest Subarray With OR at Least K II Solution 2024-11-10
3133. Minimum Array End Solution 2024-11-09
3152. Special Array II Solution 2024-12-09
3160. Find the Number of Distinct Colors Among the Balls Solution 2025-02-07
3163. String Compression III Solution 2024-11-04
3169. Count Days Without Meetings Solution 2025-03-24
3191. Minimum Operations to Make Binary Array Elements Equal to One I Solution 2025-03-19
3208. Alternating Groups II Solution 2025-03-09
3217. Delete Nodes From Linked List Present in Array Solution 2024-09-06
3223. Minimum Length of String After Operations Solution 2025-01-13
3243. Shortest Distance After Road Addition Queries I Solution 2024-11-27
3254. Find the Power of K-Size Subarrays I Solution 2024-11-16
3306. Count of Substrings Containing Every Vowel and K Consonants II Solution 2025-03-10
3356. Zero Array Transformation II Solution 2025-03-13
3394. Check if Grid can be Cut into Sections Solution 2025-03-25

Easy

Problem Solution Last Modified
20. Valid Parentheses Solution 2023-04-10
26. Remove Duplicates from Sorted Array Solution 2022-11-11
35. Search Insert Position Solution 2023-02-20
58. Length of Last Word Solution 2024-04-01
67. Add Binary Solution 2023-02-15
70. Climbing Stairs Solution 2022-12-12
94. Binary Tree Inorder Traversal Solution, Solution2 2023-12-09
100. Same Tree Solution 2023-01-10
101. Symmetric Tree Solution, Solution2 2023-03-13
104. Maximum Depth of Binary Tree Solution, Solution2, 2023-02-16
111. Minimum Depth of Binary Tree Solution 2023-07-10
112. Path Sum Solution 2022-10-04
118. Pascal's Triangle Solution 2023-09-08
119. Pascal's Triangle II Solution 2023-10-16
121. Best Time to Buy and Sell Stock Solution, Solution2 2023-02-25
141. Linked List Cycle Solution 2023-09-04
144. Binary Tree Preorder Traversal Solution, Solution2 2023-01-09
145. Binary Tree Postorder Traversal Solution, Solution2 2024-08-25
168. Excel Sheet Column Title Solution 2023-08-22
169. Majority Element Solution, Solution2 2024-02-12
191. Number of 1 Bits Solution, Solution2 2023-11-29
205. Isomorphic Strings Solution 2024-04-02
206. Reverse Linked List Solution 2024-03-21
219. Contains Duplicate II Solution 2022-10-21
225. Implement Stack using Queues Solution, Solution2 2023-08-28
226. Invert Binary Tree Solution, Solution2 2023-02-18
228. Summary Ranges Solution 2023-06-12
231. Power of Two Solution 2024-02-19
232. Implement Queue using Stacks Solution 2022-12-16
234. Palindrome Linked List Solution 2024-03-22
242. Valid Anagram Solution 2023-12-16
258. Add Digits Solution 2023-04-26
263. Ugly Number Solution 2022-11-18
268. Missing Number Solution 2024-02-20
290. Word Pattern Solution 2023-01-01
338. Counting Bits Solution, Solution2 2023-09-01
344. Reverse String Solution 2024-06-02
345. Reverse Vowels of a String Solution 2022-11-04
349. Intersection of Two Arrays Solution 2024-03-10
350. Intersection of Two Arrays II Solution 2024-07-02
374. Guess Number Higher or Lower Solution 2022-11-16
387. First Unique Character in a String Solution 2024-02-05
389. Find the Difference Solution 2023-09-26
392. Is Subsequence Solution 2023-09-22
404. Sum of Left Leaves Solution 2024-04-14
409. Longest Palindrome Solution 2024-06-04
455. Assign Cookies Solution 2024-01-01
463. Island Perimeter Solution 2024-04-18
476. Number Complement Solution 2024-08-22
506. Relative Ranks Solution 2024-05-08
520. Detect Capital Solution, Solution2 2023-01-02
530. Minimum Absolute Difference in BST Solution 2023-06-14
543. Diameter of Binary Tree Solution 2024-02-27
557. Reverse Words in a String III Solution 2022-09-22
590. N-ary Tree Postorder Traversal Solution 2024-08-26
605. Can Place Flowers Solution 2023-03-20
645. Set Mismatch Solution, Solution2 2024-01-22
653. Two Sum IV - Input is a BST Solution, Solution2 2022-10-09
661. Image Smoother Solution 2023-12-19
703. Kth Largest Element in a Stream Solution 2024-08-12
704. Binary Search Solution 2023-04-01
705. Design HashSet Solution 2023-05-30
706. Design HashMap Solution 2023-10-04
744. Find Smallest Letter Greater Than Target Solution 2023-06-09
746. Min Cost Climbing Stairs Solution 2023-10-13
766. Toeplitz Matrix Solution, Solution2 2022-10-31
783. Minimum Distance Between BST Nodes Solution, Solution2 2023-02-17
796. Rotate String Solution 2024-11-03
859. Buddy Strings Solution 2023-07-03
860. Lemonade Change Solution 2024-08-15
867. Transpose Matrix Solution 2023-12-10
872. Leaf-Similar Trees Solution 2024-01-09
876. Middle of the Linked List Solution 2024-03-07
884. Uncommon Words from Two Sentences Solution 2024-09-17
896. Monotonic Array Solution 2023-09-29
905. Sort Array By Parity Solution 2023-09-28
938. Range Sum of BST Solution 2022-12-07
944. Delete Columns to Make Sorted Solution 2023-01-03
953. Verifying an Alien Dictionary Solution 2023-02-02
976. Largest Perimeter Triangle Solution 2022-10-12
977. Squares of a Sorted Array Solution 2024-03-02
989. Add to Array-Form of Integer Solution 2023-02-15
997. Find the Town Judge Solution, Solution2 2024-02-22
1002. Find Common Characters Solution 2024-06-05
1046. Last Stone Weight Solution 2023-04-24
1047. Remove All Adjacent Duplicates In String Solution 2022-11-10
1051. Height Checker Solution 2024-06-10
1071. Greatest Common Divisor of Strings Solution 2023-02-02
1122. Relative Sort Array Solution 2024-06-11
1137. N-th Tribonacci Number Solution 2023-01-30
1160. Find Words That Can Be Formed by Characters Solution 2023-12-03
1207. Unique Number of Occurrences Solution 2024-01-17
1232. Check If It Is a Straight Line Solution 2023-06-05
1266. Minimum Time Visiting All Points Solution 2023-12-03
1287. Element Appearing More Than 25% In Sorted Array Solution 2023-12-11
1317. Convert Integer to the Sum of Two No-Zero Integers Solution 2022-09-14
1323. Maximum 69 Number Solution 2022-11-07
1331. Rank Transform of an Array Solution 2024-10-02
1337. The K Weakest Rows in a Matrix Solution 2023-09-19
1346. Check If N and Its Double Exist Solution 2024-12-01
1351. Count Negative Numbers in a Sorted Matrix Solution 2023-06-08
1356. Sort Integers by The Number of 1 Bits Solution 2023-10-30
1380. Lucky Numbers in a Matrix Solution 2024-07-19
1408. String Matching in an Array Solution, Solution2 2025-01-07
1422. Maximum Score After Splitting a String Solution, Solution2 2025-01-01
1431. Kids With the Greatest Number of Candies Solution 2023-04-17
1436. Destination City Solution 2023-12-15
1455. Check If a Word Occurs As a Prefix of Any Word in a Sentence Solution 2024-12-02
1460. Make Two Arrays Equal by Reversing Subarrays Solution 2024-08-03
1464. Maximum Product of Two Elements in an Array Solution 2023-12-12
1470. Shuffle the Array Solution, Solution2 2023-02-06
1475. Final Prices With a Special Discount in a Shop Solution 2024-12-18
1491. Average Salary Excluding the Minimum and Maximum Salary Solution 2023-05-01
1496. Path Crossing Solution 2023-12-23
1502. Can Make Arithmetic Progression From Sequence Solution 2023-06-06
1512. Number of Good Pairs Solution 2023-10-03
1518. Water Bottles Solution, Solution2 2024-07-07
1523. Count Odd Numbers in an Interval Range Solution 2023-02-13
1539. Kth Missing Positive Number Solution 2023-03-06
1544. Make The String Great Solution 2022-11-08
1550. Three Consecutive Odds Solution 2024-07-01
1572. Matrix Diagonal Sum Solution 2023-05-08
1582. Special Positions in a Binary Matrix Solution 2023-12-13
1598. Crawler Log Folder Solution 2024-07-10
1603. Design Parking System Solution 2023-05-29
1608. Special Array With X Elements Greater Than or Equal X Solution 2024-05-27
1614. Maximum Nesting Depth of the Parentheses Solution 2024-04-04
1624. Largest Substring Between Two Equal Characters Solution 2023-12-31
1636. Sort Array by Increasing Frequency Solution 2024-07-23
1652. Defuse the Bomb Solution, Solution2 2024-11-18
1662. Check If Two String Arrays are Equivalent Solution 2023-12-02
1684. Count the Number of Consistent Strings Solution 2024-09-12
1688. Count of Matches in Tournament Solution 2023-12-05
1700. Number of Students Unable to Eat Lunch Solution 2024-04-08
1701. Average Waiting Time Solution 2024-07-09
1704. Determine if String Halves Are Alike Solution 2022-12-01
1732. Find the Highest Altitude Solution 2023-06-19
1752. Check if Array Is Sorted and Rotated Solution 2025-02-02
1758. Minimum Changes To Make Alternating Binary String Solution 2023-12-24
1768. Merge Strings Alternately Solution 2023-04-18
1790. Check if One String Swap Can Make Strings Equal Solution 2025-02-05
1791. Find Center of Star Graph Solution 2024-06-27
1800. Maximum Ascending Subarray Sum Solution 2025-02-04
1822. Sign of the Product of an Array Solution 2023-05-02
1832. Check if the Sentence Is Pangram Solution 2022-10-17
1863. Sum of All Subset XOR Totals Solution, Solution2 2024-05-20
1897. Redistribute Characters to Make All Strings Equal Solution 2023-12-30
1903. Largest Odd Number in String Solution 2023-12-07
1913. Maximum Product Difference Between Two Pairs Solution 2023-12-18
1945. Sum of Digits of String After Convert Solution 2024-09-03
1957. Delete Characters to Make Fancy String Solution 2024-11-01
1971. Find if Path Exists in Graph Solution, Solution2 2024-04-21
2000. Reverse Prefix of Word Solution 2024-05-01
2022. Convert 1D Array Into 2D Array Solution 2024-09-01
2037. Minimum Number of Moves to Seat Everyone Solution 2024-06-13
2053. Kth Distinct String in an Array Solution 2024-08-05
2073. Time Needed to Buy Tickets Solution 2024-04-09
2108. Find First Palindromic String in the Array Solution 2024-02-13
2180. Count Integers With Even Digit Sum Solution 2022-09-28
2185. Counting Words With a Given Prefix Solution 2025-01-09
2206. Divide Array Into Equal Pairs Solution 2025-03-17
2210. Count Hills and Valleys in an Array Solution 2022-09-13
2215. Find the Difference of Two Arrays Solution 2023-05-03
2220. Minimum Bit Flips to Convert Number Solution 2024-09-11
2224. Minimum Number of Operations to Convert Time Solution 2022-09-13
2231. Largest Number After Digit Swaps by Parity Solution 2022-09-09
2243. Calculate Digit Sum of a String Solution 2022-09-08
2248. Intersection of Multiple Arrays Solution 2022-09-14
2259. Remove Digit From Number to Maximize Result Solution 2022-09-09
2269. Find the K-Beauty of a Number Solution 2022-09-14
2273. Find Resultant Array After Removing Anagrams Solution 2022-09-09
2287. Rearrange Characters to Make Target String Solution 2022-09-09
2331. Evaluate Boolean Binary Tree Solution 2024-05-16
2373. Largest Local Values in a Matrix Solution 2024-05-12
2379. Minimum Recolors to Get K Consecutive Black Blocks Solution 2025-03-08
2389. Longest Subsequence With Limited Sum Solution 2022-12-26
2404. Most Frequent Even Element Solution 2022-09-12
2406. Divide Intervals Into Minimum Number of Groups Solution, Solution2 2024-10-12
2418. Sort the People Solution 2024-07-22
2419. Longest Subarray With Maximum Bitwise AND Solution 2024-09-14
2441. Largest Positive Integer That Exists With Its Negative Solution 2024-05-02
2460. Apply Operations to an Array Solution 2025-03-01
2485. Find the Pivot Integer Solution 2024-03-13
2490. Circular Sentence Solution 2024-11-02
2529. Maximum Count of Positive Integer and Negative Integer Solution 2025-03-12
2540. Minimum Common Value Solution 2024-03-09
2570. Merge Two 2D Arrays by Summing Values Solution 2025-03-02
2582. Pass the Pillow Solution 2024-07-06
2678. Number of Senior Citizens Solution 2024-08-02
2696. Minimum String Length After Removing Substrings Solution 2024-10-07
2706. Buy Two Chocolates Solution 2023-12-20
2864. Maximum Odd Binary Number Solution 2024-03-01
2965. Find Missing and Repeated Values Solution, Solution2 2025-03-06
3005. Count Elements With Maximum Frequency Solution 2024-03-08
3042. Count Prefix and Suffix Pairs I Solution 2025-01-08
3105. Longest Strictly Increasing or Strictly Decreasing Subarray Solution 2025-02-03
3110. Score of a String Solution 2024-06-01
3151. Special Array I Solution 2025-02-01
3174. Clear Digits Solution 2025-02-10
3264. Final Array State After K Multiplication Operations I Solution 2024-12-16