Home
Leetcode
About
#leetcode
Sep 2022
🔀Pick One
Sep 2020
1 Two Sum
Sep 2020
2 Add Two Numbers
Jan 2020
3 Longest Substring Without Repeating Characters
Oct 2020
4 Median of Two Sorted Arrays
Sep 2020
5 Longest Palindromic Substring
Feb 2023
9 Palindrome Number
Aug 2022
10 Regular Expression Matching
Sep 2022
11 Container With Most Water
Aug 2022
12 Integer to Roman
Sep 2022
13 Roman to Integer
Feb 2023
14 Longest Common Prefix
Sep 2022
15 3Sum
Aug 2022
17 Letter Combinations of a Phone Number
Sep 2021
19 Remove Nth Node From End of List
Sep 2020
20 Valid Parentheses
Oct 2020
21 Merge Two Sorted Lists
Sep 2022
22 Generate Parentheses
Sep 2021
23 Merge k Sorted Lists
Mar 2023
28 Find the Index of the First Occurrence in a String
Sep 2022
33 Search in Rotated Sorted Array
Sep 2021
35 Search Insert Position
Sep 2021
36 Valid Sudoku
Jun 2021
42 Trapping Rain Water
Nov 2022
45 Jump Game II
Sep 2022
46 Permutations
Mar 2021
48 Rotate Image
Aug 2022
49 Group Anagrams
Mar 2021
50 Pow(x, n)
Nov 2022
51 N-Queens
Sep 2021
53 Maximum Subarray
Sep 2022
54 Spiral Matrix
Mar 2021
55 Jump Game
Aug 2022
56 Merge Intervals
Mar 2021
57 Insert Interval
Nov 2022
60 Permutation Sequence
Jun 2021
61 Rotate List
Sep 2022
66 Plus One
Jan 2023
68 Text Justification
Sep 2021
70 Climbing Stairs
Nov 2022
72 Edit Distance
Sep 2021
74 Search a 2D Matrix
Aug 2022
76 Minimum Window Substring
Sep 2021
79 Word Search
Oct 2021
83 Remove Duplicates from Sorted List
Nov 2022
86 Partition List
Sep 2021
88 Merge Sorted Array
Sep 2022
90 Subsets II
Sep 2022
91 Decode Ways
Oct 2021
94 Binary Tree Inorder Traversal
Dec 2022
95 Unique Binary Search Trees II
Sep 2022
98 Validate Binary Search Tree
Aug 2022
99 Recover Binary Search Tree
Jun 2021
100 Same Tree
Mar 2021
101 Symmetric Tree
Oct 2021
102 Binary Tree Level Order Traversal
Mar 2021
103 Binary Tree Zigzag Level Order Traversal
Oct 2021
104 Maximum Depth of Binary Tree
Sep 2022
105 Construct Binary Tree from Preorder and Inorder Traversal
Jan 2023
106 Construct Binary Tree from Inorder and Postorder Traversal
Mar 2021
109 Convert Sorted List to Binary Search Tree
Oct 2021
112 Path Sum
Mar 2021
113 Path Sum II
Jan 2023
114 Flatten Binary Tree to Linked List
Sep 2022
117 Populating Next Right Pointers in Each Node II
Sep 2021
118 Pascal's Triangle
Sep 2021
121 Best Time to Buy and Sell Stock
Oct 2020
122 Best Time to Buy and Sell Stock II
Mar 2021
123 Best Time to Buy and Sell Stock III
Sep 2022
124 Binary Tree Maximum Path Sum
Aug 2022
127 Word Ladder
Feb 2023
128 Longest Consecutive Sequence
Dec 2022
129 Sum Root to Leaf Numbers
Sep 2022
130 Surrounded Regions
Sep 2022
131 Palindrome Partitioning
Sep 2022
133 Clone Graph
Sep 2022
134 Gas Station
Aug 2022
135 Candy
Sep 2020
136 Single Number
Aug 2022
138 Copy List with Random Pointer
Aug 2022
139 Word Break
Aug 2022
140 Word Break II
Oct 2021
141 Linked List Cycle
Nov 2022
142 Linked List Cycle II
Nov 2022
143 Reorder List
Oct 2021
144 Binary Tree Preorder Traversal
Oct 2021
145 Binary Tree Postorder Traversal
Sep 2021
146 LRU Cache
Mar 2023
148 Sort List
Mar 2023
149 Max Points on a Line
Mar 2023
150 Evaluate Reverse Polish Notation
May 2023
151 Reverse Words in a String
Mar 2023
152 Maximum Product Subarray
Sep 2022
153 Find Minimum in Rotated Sorted Array
Sep 2022
155 Min Stack
Jan 2023
156 Binary Tree Upside Down
Nov 2022
159 Longest Substring with At Most Two Distinct Characters
Sep 2021
167 Two Sum II - Input array is sorted
Mar 2023
179 Largest Number
Sep 2021
189 Rotate Array
Oct 2022
198 House Robber
Sep 2022
199 Binary Tree Right Side View
Dec 2020
200 Number of Islands
Oct 2021
203 Remove Linked List Elements
Oct 2021
206 Reverse Linked List
Aug 2022
207 Course Schedule
Mar 2023
208 Implement Trie (Prefix Tree)
Aug 2022
210 Course Schedule II
Sep 2022
212 Word Search II
Sep 2022
213 House Robber II
Sep 2021
217 Contains Duplicate
Oct 2022
218 The Skyline Problem
Jan 2023
222 Count Complete Tree Nodes
Oct 2021
226 Invert Binary Tree
Aug 2022
227 Basic Calculator II
Oct 2020
231 Power of Two
Oct 2021
232 Implement Queue using Stacks
Oct 2021
235 Lowest Common Ancestor of a Binary Search Tree
Aug 2022
236 Lowest Common Ancestor of a Binary Tree
Aug 2022
239 Sliding Window Maximum
Dec 2020
242 Valid Anagram
Sep 2022
247 Strobogrammatic Number II
Jan 2023
250 Count Univalue Subtrees
Sep 2021
253 Meeting Rooms II
Jan 2023
255 Verify Preorder Sequence in Binary Search Tree
Nov 2022
256 Paint House
Sep 2022
269 Alien Dictionary
Sep 2022
273 Integer to English Words
Mar 2021
274 H-Index
Sep 2021
278 First Bad Version
Mar 2023
279 Perfect Squares
Feb 2023
282 Expression Add Operators
Sep 2021
283 Move Zeroes
Sep 2022
286 Walls and Gates
Sep 2022
289 Game of Life
Oct 2021
295 Find Median from Data Stream
Sep 2022
300 Longest Increasing Subsequence
Oct 2022
301 Remove Invalid Parentheses
Sep 2022
304 Range Sum Query 2D - Immutable
Nov 2022
308 Range Sum Query 2D - Mutable
Oct 2022
310 Minimum Height Trees
Sep 2022
311 Sparse Matrix Multiplication
Sep 2022
314 Binary Tree Vertical Order Traversal
Mar 2023
315 Count of Smaller Numbers After Self
Sep 2022
316 Remove Duplicate Letters
Aug 2022
322 Coin Change
Sep 2022
329 Longest Increasing Path in a Matrix
Sep 2022
331 Verify Preorder Serialization of a Binary Tree
Nov 2022
332 Reconstruct Itinerary
Sep 2022
333 Largest BST Subtree
Mar 2023
341 Flatten Nested List Iterator
Oct 2020
344 Reverse String
Mar 2021
347 Top K Frequent Elements
Sep 2022
348 Design Tic-Tac-Toe
Sep 2021
350 Intersection of Two Arrays II
Feb 2023
353 Design Snake Game
Nov 2022
354 Russian Doll Envelopes
Aug 2022
357 Count Numbers with Unique Digits
Feb 2023
359 Logger Rate Limiter
Feb 2023
362 Design Hit Counter
Sep 2022
366 Find Leaves of Binary Tree
Sep 2022
370 Range Addition
Jan 2023
379 Design Phone Directory
Aug 2022
380 Insert Delete GetRandom O(1)
Sep 2022
381 Insert Delete GetRandom O(1) - Duplicates allowed
Oct 2021
383 Ransom Note
Dec 2020
387 First Unique Character in a String
Sep 2022
390 Elimination Game
Sep 2022
394 Decode String
Sep 2022
398 Random Pick Index
Sep 2022
399 Evaluate Division
Oct 2020
400 Nth Digit
Mar 2021
405 Convert a Number to Hexadecimal
Sep 2022
410 Split Array Largest Sum
Sep 2020
412 Fizz Buzz
Nov 2022
413 Arithmetic Slices
Jan 2023
418 Sentence Screen Fitting
Feb 2023
419 Battleships in a Board
Aug 2022
420 Strong Password Checker
Feb 2023
424 Longest Repeating Character Replacement
Nov 2022
428 Serialize and Deserialize N-ary Tree
Sep 2022
430 Flatten a Multilevel Doubly Linked List
Sep 2022
443 String Compression
Sep 2022
445 Add Two Numbers II
Nov 2022
451 Sort Characters By Frequency
Jan 2023
458 Poor Pigs
Sep 2022
460 LFU Cache
Sep 2022
461 Hamming Distance
Aug 2022
472 Concatenated Words
Dec 2020
476 Number Complement
Sep 2022
489 Robot Room Cleaner
Sep 2022
490 The Maze
Aug 2022
496 Next Greater Element I
Nov 2022
503 Next Greater Element II
Jun 2021
504 Base 7
Sep 2021
509 Fibonacci Number
Mar 2021
525 Contiguous Array
Jan 2023
528 Random Pick with Weight
Sep 2022
535 Encode and Decode TinyURL
Sep 2022
538 Convert BST to Greater Tree
Jan 2023
539 Minimum Time Difference
Aug 2022
543 Diameter of Binary Tree
Sep 2022
545 Boundary of Binary Tree
Jan 2023
552 Student Attendance Record II
Sep 2021
557 Reverse Words in a String III
Aug 2022
560 Subarray Sum Equals K
Sep 2021
566 Reshape the Matrix
Sep 2021
567 Permutation in String
Sep 2022
581 Shortest Unsorted Continuous Subarray
Sep 2022
582 Kill Process
Sep 2022
588 Design In-Memory File System
Sep 2022
611 Valid Triangle Number
Sep 2021
617 Merge Two Binary Trees
May 2023
622 Design Circular Queue
Sep 2022
631 Design Excel Sum Formula
Sep 2022
634 Find the Derangement of An Array
Sep 2022
642 Design Search Autocomplete System
Nov 2022
658 Find K Closest Elements
Sep 2022
659 Split Array into Consecutive Subsequences
Feb 2023
660 Remove 9
Sep 2022
665 Non-decreasing Array
Sep 2022
680 Valid Palindrome II
Sep 2022
692 Top K Frequent Words
Sep 2022
694 Number of Distinct Islands
Sep 2021
695 Max Area of Island
Sep 2022
696 Count Binary Substrings
Oct 2021
700 Search in a Binary Search Tree
Oct 2021
701 Insert into a Binary Search Tree
Sep 2021
704 Binary Search
Jan 2023
715 Range Module
Sep 2022
716 Max Stack
Sep 2022
723 Candy Crush
Jan 2023
724 Find Pivot Index
Jan 2023
729 My Calendar I
Sep 2021
733 Flood Fill
Sep 2022
735 Asteroid Collision
Oct 2022
739 Daily Temperatures
Nov 2022
746 Min Cost Climbing Stairs
Sep 2022
767 Reorganize String
Aug 2022
772 Basic Calculator III
Nov 2022
779 K-th Symbol in Grammar
Sep 2022
797 All Paths From Source to Target
Jan 2023
818 Race Car
Nov 2022
827 Making A Large Island
Aug 2022
828 Count Unique Characters of All Substrings of a Given String
Jan 2023
843 Guess the Word
Nov 2022
845 Longest Mountain in Array
Oct 2022
852 Peak Index in a Mountain Array
Sep 2022
858 Mirror Reflection
Aug 2022
863 All Nodes Distance K in Binary Tree
Sep 2022
875 Koko Eating Bananas
Sep 2021
876 Middle of the Linked List
Nov 2022
888 Fair Candy Swap
Nov 2022
895 Maximum Frequency Stack
Sep 2022
907 Sum of Subarray Minimums
Sep 2022
909 Snakes and Ladders
Feb 2023
921 Minimum Add to Make Parentheses Valid
Sep 2022
926 Flip String to Monotone Increasing
Oct 2022
934 Shortest Bridge
Sep 2022
935 Knight Dialer
Aug 2022
937 Reorder Data in Log Files
Jan 2023
938 Range Sum of BST
Sep 2022
947 Most Stones Removed with Same Row or Column
Sep 2022
948 Bag of Tokens
Nov 2022
967 Numbers With Same Consecutive Differences
Sep 2022
968 Binary Tree Cameras
Aug 2022
973 K Closest Points to Origin
Nov 2022
974 Subarray Sums Divisible by K
Feb 2023
975 Odd Even Jump
Mar 2023
976 Largest Perimeter Triangle
Sep 2021
977 Squares of a Sorted Array
Feb 2023
983 Minimum Cost For Tickets
Sep 2022
987 Vertical Order Traversal of a Binary Tree
Sep 2022
992 Subarrays with K Different Integers
Sep 2022
993 Cousins in Binary Tree
Sep 2022
994 Rotting Oranges
Sep 2022
1010 Pairs of Songs With Total Durations Divisible by 60
Sep 2022
1011 Capacity To Ship Packages Within D Days
Mar 2021
1022 Sum of Root To Leaf Binary Numbers
Sep 2022
1029 Two City Scheduling
Sep 2022
1038 Binary Search Tree to Greater Sum Tree
Sep 2022
1041 Robot Bounded In Circle
Jan 2023
1048 Longest String Chain
Feb 2023
1052 Grumpy Bookstore Owner
Feb 2023
1055 Shortest Way to Form String
Sep 2022
1081 Smallest Subsequence of Distinct Characters
Sep 2022
1094 Car Pooling
Sep 2022
1099 Two Sum Less Than K
Jan 2023
1101 The Earliest Moment When Everyone Become Friends
Jan 2023
1102 Path With Maximum Minimum Value
Jan 2023
1105 Filling Bookcase Shelves
Sep 2022
1109 Corporate Flight Bookings
Feb 2023
1110 Delete Nodes And Return Forest
Mar 2021
1114 Print in Order
Nov 2022
1129 Shortest Path with Alternating Colors
Jan 2023
1136 Parallel Courses
Sep 2021
1137 N-th Tribonacci Number
Nov 2022
1143 Longest Common Subsequence
Jan 2023
1146 Snapshot Array
Sep 2022
1151 Minimum Swaps to Group All 1's Together
Aug 2022
1152 Analyze User Website Visit Pattern
Feb 2023
1155 Number of Dice Rolls With Target Sum
Feb 2023
1166 Design File System
Sep 2022
1167 Minimum Cost to Connect Sticks
Sep 2022
1169 Invalid Transactions
Feb 2023
1171 Remove Zero Sum Consecutive Nodes from Linked List
Mar 2023
1189 Maximum Number of Balloons
Sep 2022
1192 Critical Connections in a Network
Feb 2023
1197 Minimum Knight Moves
Nov 2022
1200 Minimum Absolute Difference
Feb 2023
1202 Smallest String With Swaps
Aug 2022
1207 Unique Number of Occurrences
Sep 2022
1209 Remove All Adjacent Duplicates in String II
Jan 2023
1220 Count Vowels Permutation
Sep 2022
1229 Meeting Scheduler
Sep 2022
1236 Web Crawler
Sep 2022
1244 Design A Leaderboard
Oct 2022
1245 Tree Diameter
Sep 2022
1249 Minimum Remove to Make Valid Parentheses
Feb 2023
1263 Minimum Moves to Move a Box to Their Target Location
Aug 2022
1268 Search Suggestions System
Sep 2022
1274 Number of Ships in a Rectangle
Aug 2022
1275 Find Winner on a Tic Tac Toe Game
Sep 2022
1291 Sequential Digits
Oct 2022
1293 Shortest Path in a Grid with Obstacles Elimination
Feb 2023
1296 Divide Array in Sets of K Consecutive Numbers
Mar 2021
1325 Delete Leaves With a Given Value
Nov 2022
1331 Rank Transform of an Array
Sep 2022
1332 Remove Palindromic Subsequences
Sep 2022
1335 Minimum Difficulty of a Job Schedule
Nov 2022
1338 Reduce Array Size to The Half
Sep 2022
1339 Maximum Product of Splitted Binary Tree
Sep 2022
1342 Number of Steps to Reduce a Number to Zeroe
Sep 2022
1342 Number of Steps to Reduce a Number to Zeroe
Sep 2022
1347 Minimum Number of Steps to Make Two Strings Anagram
Sep 2022
1352 Product of the Last K Numbers
Feb 2023
1353 Maximum Number of Events That Can Be Attended
Nov 2022
1354 Construct Target Array With Multiple Sums
Sep 2022
1358 Number of Substrings Containing All Three Characters
Aug 2022
1360 Number of Days Between Two Dates
Feb 2023
1363 Largest Multiple of Three
Feb 2023
1383 Maximum Performance of a Team
Nov 2022
1387 Sort Integers by The Power Value
Sep 2022
1396 Design Underground System
Mar 2021
1413 Minimum Value to Get Positive Step by Step Sum
Sep 2022
1429 First Unique Number
Sep 2022
1438 Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit
Sep 2022
1444 Number of Ways of Cutting a Pizza
Sep 2022
1454 Active Users
Sep 2022
1465 Maximum Area of a Piece of Cake After Horizontal and Vertical Cuts
Sep 2022
1472 Design Browser History
Jan 2023
1480 Running Sum of 1d Array
Sep 2022
1492 The kth Factor of n
Feb 2023
1494 Parallel Courses II
Feb 2023
1504 Count Submatrices With All Ones
Nov 2022
1506 Find Root of N-Ary Tree
Feb 2023
1525 Number of Good Ways to Split a String
Nov 2022
1547 Minimum Cost to Cut a Stick
Sep 2022
1567 Maximum Length of Subarray With Positive Product
Sep 2022
1570 Dot Product of Two Sparse Vectors
Mar 2023
1578 Minimum Time to Make Rope Colorful
Nov 2022
1582 Special Positions in a Binary Matrix
Sep 2022
1583 Count Unhappy Friends
Feb 2023
1592 Rearrange Spaces Between Words
Sep 2022
1597 Build Binary Expression Tree From Infix Expression
Aug 2022
1603 Design Parking System
Jan 2023
1606 Find Servers That Handled Most Number of Requests
Jan 2023
1610 Maximum Number of Visible Points
Sep 2022
1614 Maximum Nesting Depth of the Parentheses
Mar 2023
1615 Maximal Network Rank
Sep 2022
1628 Design an Expression Tree With Evaluate Function
Feb 2023
1642 Furthest Building You Can Reach
Sep 2022
1656 Design an Ordered Stream
Feb 2023
1657 Determine if Two Strings Are Close
Sep 2022
1698 Number of Distinct Substrings in a String
Aug 2022
1710 Maximum Units on a Truck
Sep 2022
1730 Shortest Path to Get Food
Feb 2023
1755 Closest Subsequence Sum
May 2023
1768 Merge Strings Alternately
Nov 2022
1790 Check if One String Swap Can Make Strings Equal
Sep 2022
1823 Find the Winner of the Circular Game
Aug 2022
1834 Single-Threaded CPU
Feb 2023
1851 Minimum Interval to Include Each Query
Nov 2022
1854 Maximum Population Year
Jan 2023
1889 Minimum Space Wasted From Packaging
Feb 2023
1996 The Number of Weak Characters in the Game
Jan 2023
2013 Detect Squares
Sep 2022
2021 Brightest Position on Street
Sep 2022
2028 Find Missing Observations
Jan 2023
2034 Stock Price Fluctuation
Mar 2023
2035 Partition Array Into Two Arrays to Minimize Sum Difference
Sep 2022
2055 Plates Between Candles
Oct 2022
2096 Step-By-Step Directions From a Binary Tree Node to Another
Jan 2023
2101 Detonate the Maximum Bombs
Aug 2022
2104 Sum of Subarray Ranges
Jan 2023
2115 Find All Possible Recipes from Given Supplies
Nov 2022
2127 Maximum Employees to Be Invited to a Meeting
Sep 2022
2130 Maximum Twin Sum of a Linked List
Jan 2023
2158 Amount of New Area Painted Each Day
Jan 2023
2184 Number of Ways to Build Sturdy Brick Wall
Feb 2023
2185 Counting Words With a Given Prefix
Jan 2023
2188 Minimum Time to Finish the Race
Sep 2022
2193 Minimum Number of Moves to Make Palindrome
Aug 2022
2214 Minimum Health to Beat Game
Sep 2022
2221 Find Triangular Sum of an Array
Sep 2022
2222 Number of Ways to Select Buildings
Feb 2023
2244 Minimum Rounds to Complete All Tasks
Sep 2022
2268 Minimum Number of Keypresses
Aug 2022
2272 Substring With Largest Variance
Nov 2022
2276 Count Integers in Intervals
Aug 2022
2281 Sum of Total Strength of Wizards
Nov 2022
2303 Calculate Amount Paid in Taxes
Feb 2023
2311 Longest Binary Subsequence Less Than or Equal to K
Feb 2023
2332 The Latest Time to Catch a Bus
Feb 2023
2340 Minimum Adjacent Swaps to Make a Valid Array
Jan 2023
2345 Finding the Number of Visible Mountains
Feb 2023
2355 Maximum Number of Books You Can Take
Jan 2023
2366 Minimum Replacements to Sort the Array
Feb 2023
2398 Maximum Number of Robots Within Budget
Jan 2023
2402 Meeting Rooms III
Feb 2023
2407 Longest Increasing Subsequence II
Jan 2023
2416 Sum of Prefix Scores of Strings
Jan 2023
2421 Number of Good Paths
Jan 2023
2426 Number of Pairs Satisfying Inequality
Feb 2023
2435 Paths in Matrix Whose Sum Is Divisible by K
Mar 2023
2444 Count Subarrays With Fixed Bounds
Jan 2023
2458 Height of Binary Tree After Subtree Removal Queries