0001 |
Two Sum |
Array |
Easy |
C++ |
0002 |
Add Two Numbers |
Linked List |
Medium |
C++ |
0003 |
Longest Substring Without Repeating Characters |
Hashed Table, Two Pointers, String |
Medium |
C++ |
0004 |
Median of Two Sorted Arrays |
Array, Binary Search, Divde and Conquer |
Hard |
C++ |
0005 |
Longest Palindromic Substring |
String, Dynamic Programming |
Medium |
C++ |
0006 |
ZigZag Conversion |
String |
Medium |
C++ |
0007 |
Reverse Integer |
Math |
Easy |
C++ |
0008 |
String to Integer (atoi) |
String |
Medium |
C++ |
0010 |
Regular Expression Matching |
DP |
Hard |
C++ |
0012 |
Integer to Roman |
Hash |
Medium |
C++ |
0013 |
Roman to Integer |
String, Hash |
Easy |
C++ |
0014 |
Longest Common Prefix |
String |
Easy |
C++ |
0015 |
3Sum |
Array, Two Pointers |
Medium |
C++ |
0016 |
3Sum Closest |
Two Pointers |
Medium |
C++ |
0017 |
Letter Combinations of a Phone Number |
Backtracking |
Medium |
C++ |
0019 |
Remove Nth Node From End of List |
Linked List |
Medium |
C++ |
0020 |
Valid Parentheses |
Stack |
Easy |
C++ |
0021 |
Merge Two Sorted Lists |
Linked List, Recursion |
Easy |
C++ |
0022 |
Generate Parentheses |
String, Backtracking, Dynamic Programming |
Medium |
C++ |
0023 |
Merge k Sorted Lists |
Linked List, Divide and Conquer, Heap |
Hard |
C++ |
0024 |
Swap Nodes in Pairs |
Linked List |
Medium |
C++ |
0025 |
Reverse Nodes in k-Group |
Linked List |
Hard |
C++ |
0026 |
Remove Duplicates from Sorted Array |
Two Pointers |
Easy |
C++ |
0028 |
Implement strStr() |
String |
Easy |
C++ |
0029 |
Divide Two Integers |
Bit |
Medium |
C++ |
0030 |
Substring with Concatenation of All Words |
Hash |
Hard |
C++ |
0031 |
Next Permutation |
Two Pointers |
Medium |
C++ |
0032 |
Longest Valid Parentheses |
Dynamic Programming |
Hard |
C++ |
0033 |
Search in Rotated Sorted Array |
Array, Binary Search |
Medium |
C++ |
0034 |
Find First and Last Position of Element in Sorted Array |
Two Pointers |
Medium |
C++ |
0035 |
Search Insert Position |
Binary Search |
Easy |
C++ |
0036 |
Valid Sudoku |
Hash |
Medium |
C++ |
0037 |
Sudoku Solver |
Backtracking |
Hard |
C++ |
0038 |
Count and Say |
String |
Medium |
C++ |
0040 |
Combination Sum II |
Backtracking |
Medium |
C++ |
0041 |
First Missing Positive |
Array |
Hard |
C++ |
0042 |
Trapping Rain Water |
Array, Two Pointers, Dynamic Programming, Stack |
Hard |
C++ |
0044 |
Wildcard Matching |
Dynamic Programming, Greedy |
Hard |
C++ |
0045 |
Jump Game II |
Array,Greedy |
Hard |
C++ |
0046 |
Permutations |
Backtracking |
Medium |
C++ |
0047 |
Permutations II |
Backtracking |
Medium |
C++ |
0048 |
Rotate Image |
Array |
Medium |
C++ |
0049 |
Group Anagrams |
Hash |
Medium |
C++ |
0051 |
N-Queens |
Backtracking |
Hard |
C++ |
0053 |
Maximum Subarray |
DP |
Easy |
C++ |
0055 |
Jump Game |
Greedy |
Medium |
C++ |
0056 |
Merge Intervals |
Array, Sort |
Medium |
C++ |
0057 |
Insert Interval |
Array |
Medium |
C++ |
0060 |
Permutation Sequence |
Math, Backtracking |
Hard |
C++ |
0062 |
Unique Paths |
DP |
Medium |
C++ |
0063 |
Unique Paths II |
DP |
Medium |
C++ |
0064 |
Minimum Path Sum |
DP |
Medium |
C++ |
0067 |
Add Binary |
Math |
Easy |
C++ |
0069 |
Sqrt(x) |
Math, Binary Search |
Easy |
C++ |
0070 |
Climbing Stairs |
DP, Math |
Easy |
C++ |
0071 |
Simplify Path |
String, Stack |
Medium |
C++ |
0072 |
Edit Distance |
DP |
Hard |
C++ |
0075 |
Sort Colors |
Sort |
Medium |
C++ |
0076 |
Minimum Window Substring |
Hash Table, String, Sliding Window |
Hard |
C++ |
0077 |
Combinations |
Backtracking |
Medium |
C++ |
0079 |
Word Search |
Backtracking |
Medium |
C++ |
0080 |
Remove Duplicates from Sorted Array II |
Two Pointers |
Medium |
C++ |
0081 |
Search in Rotated Sorted Array II |
Binary Search |
Medium |
C++ |
0082 |
Remove Duplicates from Sorted List II |
Two Pointers |
Medium |
C++ |
0083 |
Remove Duplicates from Sorted List |
Linked List |
Easy |
C++ |
0086 |
Partition List |
Linked List, Two Pointers |
Medium |
C++ |
0088 |
Merge Sorted Array |
Two Pointers |
Easy |
C++ |
0091 |
Decode Ways |
DP |
Medium |
C++ |
0092 |
Reverse Linked List II |
Linked List |
Medium |
C++ |
0093 |
Restore IP Addresses |
String, Backtracking |
Medium |
C++ |
0094 |
Binary Tree Inorder Traversal |
Stack, Tree |
Medium |
C++ |
0097 |
Interleaving String |
DP |
Medium |
C++ |
0098 |
Validate Binary Search Tree |
Stack, Tree |
Medium |
C++ |
0099 |
Recover Binary Search Tree |
Binary Tree |
Medium |
C++ |
0100 |
Same Tree |
DFS, BFS |
Easy |
C++ |
0101 |
Symmetric Tree |
Binary Tree |
Easy |
C++ |
0102 |
Binary Tree Level Order Traversal |
Binary Tree |
Medium |
C++ |
0103 |
Binary Tree Zigzag Level Order Traversal |
BFS |
Medium |
C++ |
0104 |
Maximum Depth of Binary Tree |
Binary Tree |
Easy |
C++ |
0105 |
Construct Binary Tree from Preorder and Inorder Traversal |
Binary Tree |
Medium |
C++ |
0106 |
Construct Binary Tree from Inorder and Postorder Traversal |
Divide and Conquer |
Medium |
C++ |
0108 |
Convert Sorted Array to Binary Search Tree |
Divide and Conquer |
Easy |
C++ |
0109 |
Convert Sorted List to Binary Search Tree |
Binary Tree |
Medium |
C++ |
0110 |
Balanced Binary Tree |
Binary Tree |
Easy |
C++ |
0112 |
Path Sum |
DFS, BFS |
Easy |
C++ |
0114 |
Flatten Binary Tree to Linked List |
Binary Tree, DFS |
Medium |
C++ |
0118 |
Pascal's Triangle |
Dynamic Programming |
Easy |
C++ |
0120 |
Triangle |
Array, Dynamic Programming |
Medium |
C++ |
0121 |
Best Time to Buy and Sell Stock |
Array, Dynamic Programming |
Easy |
C++ |
0122 |
Best Time to Buy and Sell Stock II |
Array, Greedy |
Easy |
C++ |
0123 |
Best Time to Buy and Sell Stock III |
Array, Dynamic Programming |
Hard |
C++ |
0124 |
Binary Tree Maximum Path Sum |
Dynamic Programming, DFS |
Hard |
C++ |
0126 |
Word Ladder II |
BFS, DFS |
Hard |
C++ |
0128 |
Longest Consecutive Sequence |
Array, Union Find |
Hard |
C++ |
0129 |
Sum Root to Leaf Numbers |
DFS |
Medium |
C++ |
0130 |
Surrounded Regions |
BFS, DFS, Union Find |
Medium |
C++ |
0131 |
Palindrome Partitioning |
Backtracking |
Medium |
C++ |
0133 |
Clone Graph |
DFS, BFS, Hash |
Medium |
C++ |
0134 |
Gas Station |
Greedy |
Medium |
C++ |
0135 |
Candy |
Greedy |
Hard |
C++ |
0136 |
Single Number |
Bit |
Easy |
C++ |
0139 |
Word Break |
DP |
Medium |
C++ |
0141 |
Linked List Circle |
Linked List |
Easy |
C++ |
0142 |
Linked List Circle II |
Linked List |
Medium |
C++ |
0144 |
Binary Tree Preorder Traversal |
Binary Tree |
Easy |
C++ |
0145 |
Binary Tree Postorder Traversal |
Stack, Tree |
Medium |
C++ |
0146 |
LRU Cache |
LRU |
Medium |
C++ |
0148 |
Sort List |
Linked List, Merge Sort |
Medium |
C++ |
0149 |
Max Points on a Line |
Hash |
Hard |
C++ |
0150 |
Evaluate Reverse Polish Notation |
Stack |
Medium |
C++ |
0151 |
Reverse Words in a String |
Two Pointers, String |
Medium |
C++ |
0153 |
Find Minimum in Rotated Sorted Array |
Array, Binary Search |
Medium |
C++ |
0154 |
Find Minimum in Rotated Sorted Array II |
Array, Binary Search |
Hard |
C++ |
0155 |
Min Stack |
Stack |
Easy |
C++ |
0160 |
Intersection of Two Linked Lists |
Linked Lists, Two Pointers |
Easy |
C++ |
0167 |
Two Sum II - Input Array Is Sorted |
Two Pointers |
Medium |
C++ |
0168 |
Excel Sheet Column Title |
Math |
Easy |
C++ |
0169 |
Majority Element |
Array, Hash Table, Divde and Conquer, Sorting, Counting |
Easy |
C++ |
0172 |
Factorial Trailing Zeroes |
Math |
Medium |
C++ |
0173 |
Binary Search Tree Iterator |
Stack, Binary Tree |
Medium |
C++ |
0188 |
Best Time to Buy and Sell Stock IV |
Dynamic Programming |
Hard |
C++ |
0190 |
Reverse Bits |
Bit |
Easy |
C++ |
0191 |
Number of 1 Bits |
Bit |
Easy |
C++ |
0198 |
House Robber |
Dynamic Programming |
Easy |
C++ |
0199 |
Binary Tree Right Side View |
BFS, DFS |
Medium |
C++ |
0200 |
Number of Islands |
DFS,BFS,Union Find |
Medium |
C++ |
0202 |
Happy Number |
Two Pointers |
Easy |
C++ |
0204 |
Count Primes |
Math |
Medium |
C++ |
0205 |
Isomorphic Strings |
String, Hash |
Easy |
C++ |
0206 |
Reverse Linked List |
Linked List |
Easy |
C++ |
0207 |
Course Schedule |
Topological Sort, BFS |
Medium |
C++ |
0208 |
Implement Trie (Prefix Tree) |
Trie |
Medium |
C++ |
0210 |
Course Schedule II |
Topological Sort |
Medium |
C++ |
0211 |
Design Add and Search Words Data Structure |
Trie, DFS |
Medium |
|
0212 |
Word Search II |
Trie, Backtracking |
Hard |
C++ |
0213 |
House Robber II |
Dynamic Programming |
Medium |
C++ |
0215 |
Kth Largest Element in an Array |
Divide and Conquer, Heap |
Medium |
C++ |
0216 |
Combination Sum III |
Backtracking |
Medium |
C++ |
0217 |
Contains Duplicate |
Set |
Easy |
C++ |
0218 |
The Skyline Problem |
Heap |
Hard |
C++ |
0219 |
Contains Duplicate II |
Hash |
Easy |
C++ |
0221 |
Maximal Square |
Dynamic Programming |
Medium |
C++ |
0222 |
Count Complete Tree Nodes |
Binary Search, DFS |
Medium |
C++ |
0223 |
Rectangle Area |
Geometry |
Medium |
C++ |
0224 |
Basic Calculator |
Math, Stack |
Hard |
C++ |
0225 |
Implement Stack using Queues |
Stack, Queue |
Easy |
C++ |
0226 |
Invert Binary Tree |
Binary Tree |
Easy |
C++ |
0227 |
Basic Calculator II |
String, Stack |
Medium |
C++ |
0232 |
Implement Queue using Stacks |
Stack |
Easy |
C++ |
0234 |
Palindrome Linked List |
Linked List, Two Pointers, Stack, Recursion |
Easy |
C++ |
0235 |
Lowest Common Ancestor of a Binary Search Tree |
Binary Search Tree |
Easy |
C++ |
0236 |
Lowest Common Ancestor of a Binary Tree |
Binary Tree |
Medium |
C++ |
0238 |
Product of Array Except Self |
Math |
Medium |
C++ |
0239 |
Sliding Window Maximum |
Deque |
Hard |
C++ |
0240 |
Search a 2D Matrix II |
Binary Search |
Medium |
C++ |
0241 |
Different Ways to Add Parentheses |
Divide and Conquer |
Medium |
C++ |
0242 |
Valid Anagram |
String, Hash |
Easy |
C++ |
0257 |
Binary Tree Paths |
DFS, Tree |
Easy |
C++ |
0260 |
Single Number III |
Bit |
Medium |
C++ |
0263 |
Ugly Number |
Math |
Easy |
C++ |
0268 |
Missing Number |
Bit |
Easy |
C++ |
0279 |
Perfect Squares |
DP, Math |
Medium |
C++ |
0284 |
Peeking Iterator |
Iterator, Design |
Medium |
C++ |
0287 |
Find the Duplicate Number |
Two Pointers, Binary Search |
Medium |
C++ |
0290 |
Word Pattern |
Hash |
Easy |
C++ |
0295 |
Find Median from Data Stream |
Heap |
Hard |
C++ |
0296 |
Best Meeting Point 1 2 |
Math |
Medium |
C++ |
0300 |
Longest Increasing Subsequence |
DP |
Medium |
C++ |
0303 |
Range Sum Query - Immutable |
Prefix Sum |
Easy |
C++ |
0304 |
Range Sum Query 2D - Immutable |
Prefix Sum |
Medium |
C++ |
0307 |
Range Sum Query - Mutable |
Fenwick Tree, Segment Tree |
Medium |
C++ |
0309 |
Best Time to Buy and Sell Stock with Cooldown |
Dynamic Programming |
Medium |
C++ |
0310 |
Minimum Height Trees |
Topological Sort |
Medium |
C++ |
0312 |
Burst Balloons |
Divide and Conquer, DP |
Hard |
C++ |
0313 |
Super Ugly Number |
DP, Heap |
Medium |
C++ |
0315 |
Count of Smaller Numbers After Self |
Divide and Conquer, Merge Sort, Segment Tree |
Hard |
C++ |
0316 |
Remove Duplicate Letters |
Greedy, Monotonic Stack |
Hard |
C++ |
0318 |
Maximum Product of Word Lengths |
Bit |
Medium |
C++ |
0322 |
Coin Change |
DP |
Medium |
C++ |
0326 |
Power of Three |
Math |
Easy |
C++ |
0328 |
Odd Even Linked List |
Linked List |
Medium |
C++ |
0329 |
Longest Increasing Path in a Matrix |
DFS, Topological Sort, DP |
Hard |
C++ |
0332 |
Reconstruct Itinerary |
Multiset, DFS, Graph, Eulerian Circuit |
Hard |
C++ |
0334 |
Increasing Triplet Subsequence |
Greedy |
Medium |
C++ |
0336 |
Palindrome Pairs |
Hash, Trie |
Hard |
C++ |
0338 |
Counting Bits |
Bit |
Easy |
C++ |
0340 |
Longest Substring with At Most K Distinct Characters |
Two Pointers |
Hard |
C++ |
0341 |
Flatten Nested List Iterator |
DFS, Stack |
Medium |
C++ |
0342 |
Power of Four |
Bit |
Easy |
C++ |
0343 |
Integer Break |
DP, Math |
Medium |
C++ |
0345 |
Reverse Vowels of a String |
Two Pointers |
Easy |
C++ |
0347 |
Top K Frequent Elements |
Sort |
Medium |
C++ |
0352 |
Data Stream as Disjoint Intervals |
Binary Search, Ordered Set |
Hard |
C++ |
0354 |
Russian Doll Envelopes |
Binary Search, Dynamic Programming |
Hard |
C++ |
0363 |
Max Sum of Rectangle No Larger Than K |
Prefix Sum, Binary Search, Ordered Set |
Hard |
C++ |
0372 |
Super Pow |
Math |
Medium |
C++ |
0373 |
Find K Pairs with Smallest Sums |
Binary Search, Heap |
Medium |
C++ |
0374 |
Guess Number Higher or Lower |
Binary Search |
Easy |
C++ |
0376 |
Wiggle Subsequence |
DP |
Medium |
C++ |
0377 |
Combination Sum IV |
DP |
Medium |
C++ |
0378 |
Kth Smallest Element in a Sorted Matrix |
Binary Search |
Medium |
C++ |
0380 |
Insert Delete GetRandom O(1) |
Hash, Random |
Medium |
C++ |
0382 |
Linked List Random Node |
Math |
Medium |
C++ |
0383 |
Ransom Note |
Hash |
Easy |
C++ |
0384 |
Shuffle an Array |
Math |
Medium |
C++ |
0387 |
First Unique Character in a String |
Hash, Queue |
Easy |
C++ |
0393 |
UTF-8 Validation |
Bit Manipulation |
Medium |
C++ |
0394 |
Decode String |
String, Stack, Recursion |
Medium |
C++ |
0399 |
Evaluate Division |
BFS, DFS, Disjoint Union Set |
Medium |
C++ |
0402 |
Remove K Digits |
Greedy, Monotonic Stack |
Medium |
C++ |
0404 |
Sum of Left Leaves |
Binary Tree |
Easy |
C++ |
0406 |
Queue Reconstruction by Height |
Greedy, Segment Tree |
Medium |
C++ |
0409 |
Longest Palindrome |
Greedy, String |
Easy |
C++ |
0411 |
Minimum Unique Word Abbreviation |
Bit Mask |
Hard |
C++ |
0413 |
Arithmetic Slices |
DP |
Medium |
C++ |
0415 |
Add Strings |
Math |
Easy |
C++ |
0416 |
Partition Equal Subset Sum |
DP |
Medium |
C++ |
0417 |
Pacific Atlantic Water Flow |
BFS, DFS |
Medium |
C++ |
0424 |
Longest Repeating Character Replacement |
Hash Table, String, Sliding Window |
Medium |
C++ |
0427 |
Construct Quad Tree |
Divide and Conquer |
Medium |
C++ |
0429 |
N-ary Tree Level Order Traversal |
BFS |
Medium |
C++ |
0432 |
All O`one Data Structure |
Design |
Hard |
C++ |
0433 |
Minimum Genetic Mutation |
BFS |
Medium |
C++ |
0435 |
Non-overlapping Intervals |
Greedy |
Medium |
C++ |
0437 |
Path Sum III |
Linked List, Prefix Sum |
Medium |
C++ |
0443 |
String Compression |
Two Pointers |
Medium |
C++ |
0438 |
Find All Anagrams in a String |
Sliding Window, Hash |
Medium |
C++ |
0446 |
Arithmetic Slices II - Subsequence |
DP |
Hard |
C++ |
0448 |
Find All Numbers Disappeared in an Array |
Array |
Easy |
C++ |
0450 |
Delete Node in a BST |
Binary Tree |
Medium |
C++ |
0451 |
Sort Characters By Frequency |
Sort |
Medium |
C++ |
0452 |
Minimum Number of Arrows to Burst Balloons |
Sort, Greedy |
Medium |
C++ |
0455 |
Assign Cookies |
Greedy |
Easy |
C++ |
0456 |
132 Pattern |
Monotonic Stack |
Medium |
C++ |
0458 |
Poor Pigs |
DP, Combinatorics, Math |
Hard |
C++ |
0460 |
LFU Cache |
Hash, Double Linked List |
Hard |
C++ |
0461 |
Hamming Distance |
Bit |
Easy |
C++ |
0462 |
Minimum Moves to Equal Array Elements II |
Math |
Medium |
C++ |
0464 |
Can I Win |
Math, Bit |
Medium |
C++ |
0470 |
Implement Rand10() Using Rand7() |
Math |
Medium |
C++ |
0472 |
Concatenated Words |
DP, Trie |
Hard |
C++ |
0473 |
Matchsticks to Square |
Backtracking, DP |
Medium |
C++ |
0474 |
Ones and Zeroes |
DP |
Medium |
C++ |
0476 |
Number Complement |
Bit |
Easy |
C++ |
0481 |
Magical String |
Two Pointers |
Medium |
C++ |
0491 |
Non-decreasing Subsequences |
Backtracking, Bit |
Medium |
C++ |
0494 |
Target Sum |
DP |
Medium |
C++ |
0496 |
Next Greater Element I |
Stack |
Easy |
C++ |
0502 |
IPO |
Heap, Sort, Greedy |
Hard |
C++ |
0503 |
Next Greater Element II |
Monotonic Stack |
Medium |
C++ |
0504 |
Base 7 |
Math |
Easy |
C++ |
0509 |
Fibonacci Number |
Math |
Easy |
C++ |
0513 |
Find Bottom Left Tree Value |
Binary Tree |
Easy |
C++ |
0516 |
Longest Palindromic Subsequence |
DP |
Medium |
C++ |
0520 |
Detect Capital |
String |
Easy |
C++ |
0523 |
Continuous Subarray Sum |
Prefix |
Medium |
C++ |
0524 |
Longest Word in Dictionary through Deleting |
Greedy, State Machine |
Medium |
C++ |
0528 |
Random Pick with Weight |
Math |
Medium |
C++ |
0530 |
Minimum Absolute Difference in BST |
Binary Tree |
Easy |
C++ |
0535 |
Encode and Decode TinyURL |
Hash, String |
Medium |
C++ |
0538 |
Convert BST to Greater Tree |
Binary Tree |
Medium |
C++ |
0540 |
Single Element in a Sorted Array |
Binary Search |
Medium |
C++ |
0542 |
01 Matrix |
DP |
Medium |
C++ |
0543 |
Diameter of Binary Tree |
Binary Tree |
Easy |
C++ |
0547 |
Number of Provinces |
DFS, Union Find |
Medium |
C++ |
0557 |
Reverse Words in a String III |
String |
Easy |
C++ |
0560 |
Subarray Sum Equals K |
Prefix Sum, Hash |
Medium |
C++ |
0566 |
Reshape the Matrix |
Matrix |
Easy |
C++ |
0567 |
Permutation in String |
Two Pointers, Sliding Window |
Medium |
C++ |
0572 |
Subtree of Another Tree |
Binary Tree |
Easy |
C++ |
0576 |
Out of Boundary Paths |
DP, DFS |
Medium |
C++ |
0581 |
Shortest Unsorted Continuous Subarray |
Two Pointers |
Medium |
C++ |
0583 |
Delete Operation for Two Strings |
DP |
Medium |
C++ |
0587 |
Erect the Fence |
Geometry |
Hard |
C++ |
0594 |
Longest Harmonious Subsequence |
Hash, Two Pointers |
Easy |
C++ |
0605 |
Can Place Flowers |
Greedy |
Easy |
C++ |
0606 |
Construct String from Binary Tree |
DFS |
Easy |
C++ |
0609 |
Find Duplicate File in System |
Hash |
Medium |
C++ |
0617 |
Merge Two Binary Trees |
Binary Tree |
Easy |
C++ |
0622 |
Design Circular Queue |
Queue, Design |
Medium |
C++ |
0623 |
Add One Row to Tree |
DFS, BFS |
Medium |
C++ |
0629 |
K Inverse Pairs Array |
DP |
Hard |
C++ |
0630 |
Course Schedule III |
Greedy, Heap |
Hard |
C++ |
0633 |
Sum of Square Numbers |
Two Pointers |
Medium |
C++ |
0636 |
Exclusive Time of Functions |
Stack |
Medium |
C++ |
0637 |
Average of Levels in Binary Tree |
Binary Tree |
Easy |
C++ |
0640 |
Solve the Equation |
Simulation |
Medium |
C++ |
0641 |
Design Circular Deque |
Queue, Design |
Medium |
C++ |
0645 |
Set Mismatch |
Hash, Bit |
Easy |
C++ |
0646 |
Maximum Length of Pair Chain |
DP |
Medium |
C++ |
0647 |
Palindromic Substrings |
String, DP |
Medium |
C++ |
0650 |
2 Keys Keyboard |
DP, Math |
Medium |
C++ |
0652 |
Find Duplicate Subtrees |
Hash, DFS |
Medium |
C++ |
0653 |
Two Sum IV - Input is a BST |
Binary Tree |
Easy |
C++ |
0654 |
Maximum Binary Tree |
Divide and Conquer, Segment Tree, Monotonic Stack |
Medium |
C++ |
0655 |
Print Binary Tree |
DFS, BFS |
Medium |
C++ |
0658 |
Find K Closest Elements |
Binary Search, Two Pointers |
Medium |
C++ |
0659 |
Split Array into Consecutive Subsequences |
Hash, Greedy, Heap |
Medium |
C++ |
0662 |
Maximum Width of Binary Tree |
DFS, BFS |
Medium |
C++ |
0665 |
Non-decreasing Array |
Greedy |
Medium |
C++ |
0667 |
Beautiful Arrangement II |
Math |
Medium |
C++ |
0668 |
Kth Smallest Number in Multiplication Table |
Binary Search |
Medium |
C++ |
0669 |
Trim a Binary Search Tree |
Binary Tree |
Medium |
C++ |
0670 |
Maximum Swap |
Greedy |
Medium |
C++ |
0672 |
Bulb Switcher II |
Math |
Medium |
C++ |
0674 |
Longest Continuous Increasing Subsequence |
Array |
Easy |
C++ |
0675 |
Cut Off Trees for Golf Event |
BFS |
Hard |
C++ |
0680 |
Valid Palindrome II |
Two Pointers |
Easy |
C++ |
0684 |
Redundant Connection |
Union Find |
Medium |
C++ |
0687 |
Longest Univalue Path |
Binary Trree |
Easy |
C++ |
0692 |
Top K Frequent Words |
Priority Queue |
Medium |
C++ |
0693 |
Binary Number with Alternating Bits |
Bit |
Easy |
C++ |
0695 |
Max Area of Island |
DFS |
Medium |
C++ |
0696 |
Count Binary Substrings |
String |
Easy |
C++ |
0697 |
Degree of an Array |
Hash |
Easy |
C++ |
0698 |
Partition to K Equal Sum Subsets |
DP, Greedy, Backtracking, Memoization |
Medium |
C++ |
0704 |
Binary Search |
Binary Search |
Easy |
C++ |
0705 |
Design HashSet |
Hash |
Easy |
C++ |
0706 |
Design HashMap |
Hash |
Easy |
C++ |
0707 |
Design Linked List |
Linked List, Design |
Medium |
C++ |
0714 |
Best Time to Buy and Sell Stock with Transaction Fee |
Array, Dynamic Programming, Greedy |
Medium |
C++ |
0716 |
Max Stack |
design |
Easy |
C++ |
0718 |
Maximum Length of Repeated Subarray |
Array, Binary Search, DP, Sliding Window, Rolling Hash, Hash |
Medium |
C++ |
0719 |
Find K-th Smallest Pair Distance |
Binary Search |
Hard |
C++ |
0727 |
Minimum Window Subsequence |
DP |
Hard |
C++ |
0729 |
My Calendar I |
Binary Search, Segment Tree |
Medium |
C++ |
0732 |
My Calendar III |
Differece Array, Segment Tree |
Hard |
C++ |
0739 |
Daily Temperatures |
Monotonic Stack |
Medium |
C++ |
0743 |
Network Delay Time |
Shortest Path |
Medium |
C++ |
0746 |
Min Cost Climbing Stairs |
DP |
Easy |
C++ |
0745 |
Prefix and Suffix Search |
Trie, Prefix |
Hard |
C++ |
0753 |
Cracking the Safe |
Eulerian Circuit |
Hard |
C++ |
0754 |
Reach a Number |
Math |
Medium |
C++ |
0761 |
Special Binary String |
Recursion |
Hard |
C++ |
0764 |
Largest Plus Sign |
DP |
Medium |
C++ |
0766 |
Toeplitz Matrix |
Matrix |
Easy |
C++ |
0768 |
Max Chunks To Make Sorted II |
Greedy, Monotonic Stack |
Hard |
C++ |
0769 |
Max Chunks To Make Sorted |
Monotonic Stack |
Medium |
C++ |
0772 |
Basic Calculator III |
Stack, String |
Hard |
C++ |
0775 |
Global and Local Inversions |
Math, Segment Tree |
Medium |
C++ |
0777 |
Swap Adjacent in LR String |
Two Pointers |
Medium |
C++ |
0779 |
K-th Symbol in Grammar |
Recursion |
Medium |
C++ |
0782 |
Transform to Chessboard |
Bit |
Hard |
C++ |
0783 |
Minimum Distance Between BST Nodes |
BST |
Easy |
C++ |
0784 |
Letter Case Permutation |
Bit, Backtracking |
Medium |
C++ |
0785 |
Is Graph Bipartite? |
Graph, BFS |
Medium |
C++ |
0787 |
Cheapest Flights Within K Stops |
Shortest Path |
Medium |
C++ |
0788 |
Rotated Digits |
DP |
Medium |
C++ |
0790 |
Domino and Tromino Tiling |
DP |
Medium |
C++ |
0791 |
Custom Sort String |
Hash |
Medium |
C++ |
0792 |
Number of Matching Subsequences |
Hash, Greedy, State Machine |
Medium |
C++ |
0793 |
Preimage Size of Factorial Zeroes Function |
Math, Binary Search |
Hard |
C++ |
0795 |
Number of Subarrays with Bounded Maximum |
Monotonic Stack |
Medium |
C++ |
0797 |
All Paths From Source to Target |
Backtracking, DFS, BFS |
Medium |
C++ |
0799 |
Champagne Tower |
DP |
Medium |
C++ |
0801 |
Minimum Swaps To Make Sequences Increasing |
DP |
Hard |
C++ |
0804 |
Unique Morse Code Words |
Hash |
Easy |
C++ |
0805 |
Split Array With Same Average |
Bit, DP |
Hard |
C++ |
0808 |
Soup Servings |
DP |
Medium |
C++ |
0811 |
Subdomain Visit Count |
String, Hash |
Medium |
C++ |
0813 |
Largest Sum of Averages |
DP |
Medium |
C++ |
0814 |
Binary Tree Pruning |
DFS |
Medium |
C++ |
0816 |
Ambiguous Coordinates |
Backtracking |
Medium |
C++ |
0817 |
Linked List Components |
Hash |
Medium |
C++ |
0820 |
Short Encoding of Words |
Trie, Suffix |
Medium |
C++ |
0823 |
Binary Trees With Factors |
DP |
Medium |
C++ |
0827 |
Making A Large Island |
DFS, BFS, Union Find |
Hard |
C++ |
0828 |
Count Unique Characters of All Substrings of a Given String |
Hash, DP |
Hard |
C++ |
0831 |
Masking Personal Information |
String |
Medium |
C++ |
0834 |
Sum of Distances in Tree |
DP, DFS |
Hard |
C++ |
0835 |
Image Overlap |
Matrix, Bit |
Medium |
C++ |
0838 |
Push Dominoes |
Two Pointers |
Medium |
C++ |
0841 |
Keys and Rooms |
DFS, BFS |
Medium |
C++ |
0844 |
Backspace String Compare |
Stack, Two Pointers |
Easy |
C++ |
0850 |
Rectangle Area II |
Line Sweep, Segment Tree |
Hard |
C++ |
0854 |
K-Similar Strings |
BFS, DFS |
Hard |
C++ |
0855 |
Exam Room |
Heap |
Medium |
C++ |
0856 |
Score of Parentheses |
Stack |
Medium |
C++ |
0857 |
Minimum Cost to Hire K Workers |
Greedy, Heap |
Hard |
C++ |
0858 |
Mirror Reflection |
Math, Geometry |
Medium |
C++ |
0862 |
Shortest Subarray with Sum at Least K |
Prefix, Monotonic Stack, Heap, Queue |
Hard |
C++ |
0864 |
Shortest Path to Get All Keys |
BFS, Bit |
Hard |
C++ |
0867 |
Transpose Matrix |
Simulation |
Easy |
C++ |
0869 |
Reordered Power of 2 |
Sort |
Medium |
C++ |
0870 |
Advantage Shuffle |
Greedy |
Medium |
C++ |
0871 |
Minimum Number of Refueling Stops |
Greedy, Heap, DP |
Hard |
C++ |
0872 |
Leaf-Similar Trees |
DFS |
Easy |
C++ |
0875 |
Koko Eating Bananas |
Binary Search |
Medium |
C++ |
0876 |
Middle of the Linked List |
Two Pointers |
Easy |
C++ |
0878 |
Nth Magical Number |
Binary Search |
Hard |
C++ |
0881 |
Boats to Save People |
Greedy, Two Pointers |
Medium |
C++ |
0882 |
Reachable Nodes In Subdivided Graph |
Dijstra, Bellman Ford, Heap |
Hard |
C++ |
0889 |
Construct Binary Tree from Preorder and Postorder Traversal |
Binary Tree |
Medium |
C++ |
0890 |
Find and Replace Pattern |
Hash |
Medium |
C++ |
0891 |
Sum of Subsequence Widths |
Math |
Hard |
C++ |
0895 |
Maximum Frequency Stack |
Hash |
Hard |
C++ |
0897 |
Increasing Order Search Tree |
Binary Tree |
Easy |
C++ |
0899 |
Orderly Queue |
Sort |
Hard |
C++ |
0901 |
Online Stock Span |
Monotonic Stack |
Medium |
C++ |
0902 |
Numbers At Most N Given Digit Set |
DP |
Hard |
C++ |
0904 |
Fruit Into Baskets |
Sliding Window |
Medium |
C++ |
0905 |
Sort Array By Parity |
Two Pointers |
Easy |
C++ |
0909 |
Snakes and Ladders |
BFS |
Medium |
C++ |
0912 |
Sort an Array |
Array |
Medium |
C++ |
0915 |
Partition Array into Disjoint Intervals |
Prefix, Suffix |
Medium |
C++ |
0916 |
Word Subsets |
Hash |
Medium |
C++ |
0918 |
Maximum Sum Circular Subarray |
Dynamic Programming |
Medium |
C++ |
0919 |
Complete Binary Tree Inserter |
BFS |
Medium |
C++ |
0921 |
Minimum Add to Make Parentheses Valid |
Greedy |
Medium |
C++ |
0926 |
Flip String to Monotone Increasing |
DP, Prefix Sum |
Medium |
C++ |
0927 |
Three Equal Parts |
Simulation, Math |
Hard |
C++ |
0930 |
Binary Subarrays With Sum |
Prerfix Sum, Sliding Window, Hash |
Medium |
C++ |
0931 |
Minimum Falling Path Sum |
DP |
Medium |
C++ |
0932 |
Beautiful Array |
Divide and Conquer, DP |
Medium |
C++ |
0934 |
Shortest Bridge |
BFS |
Medium |
C++ |
0936 |
Stamping The Sequence |
Greedy, Topological Sort |
Hard |
C++ |
0938 |
Range Sum of BST |
Binary Search Tree |
Easy |
C++ |
0940 |
Distinct Subsequences II |
DP |
Hard |
C++ |
0944 |
Delete Columns to Make Sorted |
Simulation |
Easy |
C++ |
0946 |
Validate Stack Sequences |
Stack, Simulation |
Medium |
C++ |
0947 |
Most Stones Removed with Same Row or Column |
Union Find |
Medium |
C++ |
0948 |
Bag of Tokens |
Greedy, Sort |
Medium |
C++ |
0949 |
Largest Time for Given Digits |
Math |
Medium |
C++ |
0953 |
Verifying an Alien Dictionary |
Hash |
Easy |
C++ |
0958 |
Check Completeness of a Binary Tree |
BFS |
Medium |
C++ |
0967 |
Numbers With Same Consecutive Differences |
DFS, BFS |
Medium |
C++ |
0968 |
Binary Tree Cameras |
Greedy, DP |
Hard |
C++ |
0974 |
Subarray Sums Divisible by K |
Prefix Sum |
Medium |
C++ |
0976 |
Largest Perimeter Triangle |
Greedy |
Easy |
C++ |
0980 |
Unique Paths III |
Backtracking, DP |
Hard |
C++ |
0981 |
Time Based Key-Value Store |
Hash, Binary Search |
Medium |
C++ |
0982 |
Triples with Bitwise AND Equal To Zero |
Hash, Bit |
Hard |
C++ |
0983 |
Minimum Cost For Tickets |
DP |
Medium |
C++ |
0985 |
Sum of Even Numbers After Queries |
Simulation |
Medium |
C++ |
0987 |
Vertical Order Traversal of a Binary Tree |
Hash, BFS, DFS |
Hard |
C++ |
0989 |
Add to Array-Form of Integer |
Math |
Easy |
C++ |
0990 |
Satisfiability of Equality Equations |
Union Find |
Medium |
C++ |
0997 |
Find the Town Judge |
Hash |
Easy |
C++ |
0998 |
Maximum Binary Tree II |
Binary Tree |
Medium |
C++ |
1000 |
Minimum Cost to Merge Stones |
DP |
Hard |
C++ |
1011 |
Capacity To Ship Packages Within D Days |
Binary Search |
Medium |
C++ |
1012 |
Numbers With Repeated Digits |
DP, Math |
Hard |
C++ |
1017 |
Convert to Base -2 |
Math |
Medium |
C++ |
1019 |
Next Greater Node In Linked List |
Monotonic Stack |
Medium |
C++ |
1020 |
Number of Enclaves |
DFS, BFS, Union Find |
Medium |
C++ |
1023 |
Camelcase Matching |
Two Pointers, Trie |
Medium |
C++ |
1026 |
Maximum Difference Between Node and Ancestor |
DFS |
Medium |
C++ |
1032 |
Stream of Characters |
Trie |
Hard |
C++ |
1039 |
Minimum Score Triangulation of Polygon |
DP |
Medium |
C++ |
1040 |
Moving Stones Until Consecutive II |
Two Pointers |
Medium |
C++ |
1041 |
Robot Bounded In Circle |
Math, Simulation |
Medium |
C++ |
1042 |
Flower Planting With No Adjacent |
DFS, BFS |
Medium |
C++ |
1047 |
Remove All Adjacent Duplicates In String |
Stack |
Easy |
C++ |
1048 |
Longest String Chain |
DP, Two Pointers |
Medium |
C++ |
1053 |
Previous Permutation With One Swap |
Greedy |
Medium |
C++ |
1059 |
All Paths from Source Lead to Destination |
DFS, BFS, Graph |
Medium |
C++ |
1061 |
Lexicographically Smallest Equivalent String |
Union Find |
Medium |
C++ |
1071 |
Greatest Common Divisor of Strings |
Math, String |
Easy |
C++ |
1074 |
Number of Submatrices That Sum to Target |
Hash, Prefix Sum |
Hard |
C++ |
1081 |
Smallest Subsequence of Distinct Characters |
Greedy, Monotonic Stack |
Medium |
C++(Same with 316) |
1091 |
Shortest Path in Binary Matrix |
BFS |
Medium |
C++ |
1092 |
Shortest Common Supersequence |
DP |
Hard |
C++ |
1096 |
Brace Expansion II |
BFS, Backtracking |
Hard |
C++ |
1106 |
Parsing A Boolean Expression |
Stack |
Hard |
C++ |
1110 |
Delete Nodes And Return Forest |
Binary Tree |
Medium |
C++ |
1124 |
Longest Well-Performing Interval |
Prefix Sum, Monotonic Stack |
Medium |
C++ |
1125 |
Smallest Sufficient Team |
DP, Bitmask |
Hard |
C++ |
1129 |
Shortest Path with Alternating Colors |
BFS |
Medium |
C++ |
1135 |
Connecting Cities With Minimum Cost |
Minimum spanning tree |
Medium |
C++ |
1137 |
N-th Tribonacci Number |
Simulation, DP |
Easy |
C++ |
1138 |
Alphabet Board Path |
Hash |
Medium |
C++ |
1139 |
Largest 1-Bordered Square |
DP, Prefix Sum |
Medium |
C++ |
1140 |
Stone Game II |
DP |
Medium |
C++ |
1143 |
Longest Common Subsequence |
DP |
Medium |
C++ |
1144 |
Decrease Elements To Make Array Zigzag |
Greedy |
Medium |
C++ |
1145 |
Binary Tree Coloring Game |
DFS |
Medium |
C++ |
1147 |
Longest Chunked Palindrome Decomposition |
Greedy, Two Pointers, Rolling Hash, DP |
Hard |
|
1155 |
Number of Dice Rolls With Target Sum |
DP |
Medium |
C++ |
1162 |
As Far from Land as Possible |
DP, BFS |
Medium |
C++ |
1202 |
Smallest String With Swaps |
Union Find |
Medium |
C++ |
1207 |
Unique Number of Occurrences |
Hash |
Easy |
C++ |
1209 |
Remove All Adjacent Duplicates in String II |
Stack, String |
Medium |
C++ |
1210 |
Minimum Moves to Reach Target with Rotations |
BFS |
Hard |
C++ |
1220 |
Count Vowels Permutation |
DP |
Hard |
C++ |
1223 |
Dice Roll Simulation |
DP |
Hard |
C++ |
1224 |
Maximum Equal Frequency |
Hash |
Hard |
C++ |
1233 |
Remove Sub-Folders from the Filesystem |
Trie, Sort |
Medium |
C++ |
1234 |
Replace the Substring for Balanced String |
Sliding Window |
Medium |
C++ |
1235 |
Maximum Profit in Job Scheduling |
Interval, DP |
Hard |
C++ |
1237 |
Find Positive Integer Solution for a Given Equation |
Binary Search, Two Pointers |
Medium |
C++ |
1238 |
Circular Permutation in Binary Representation |
Backtracking |
Medium |
C++ |
1239 |
Maximum Length of a Concatenated String with Unique Characters |
Bit, Backtracking |
Medium |
C++ |
1247 |
Minimum Swaps to Make Strings Equal |
Greedy |
Medium |
C++ |
1250 |
Check If It Is a Good Array |
Math, Number Theory |
Hard |
C++ |
1254 |
Number of Closed Islands |
DFS, BFS, Union Find |
Medium |
C++ |
1255 |
Maximum Score Words Formed by Letters |
Backtracking, Bit |
Hard |
C++ |
1263 |
Minimum Moves to Move a Box to Their Target Location |
BFS |
Hard |
C++ |
1268 |
Search Suggestions System |
Trie, Binary Search |
Medium |
C++ |
1282 |
Group the People Given the Group Size They Belong To |
Hash, Simulation |
Medium |
C++ |
1293 |
Shortest Path in a Grid with Obstacles Elimination |
BFS |
Hard |
C++ |
1302 |
Deepest Leaves Sum |
BFS |
Medium |
C++ |
1319 |
Number of Operations to Make Network Connected |
BFS, DFS, Union Find |
Medium |
C++ |
1323 |
Maximum 69 Number |
Greedy |
Easy |
C++ |
1326 |
Minimum Number of Taps to Open to Water a Garden |
Greedy |
Hard |
C++ |
1328 |
Break a Palindrome |
Greedy |
Medium |
C++ |
1329 |
Sort the Matrix Diagonally |
Sort |
Medium |
C++ |
1332 |
Remove Palindromic Subsequences |
Two Pointers, Simulation |
Easy |
C++ |
1334 |
Find the City With the Smallest Number of Neighbors at a Threshold Distance |
Floyd |
Medium |
C++ |
1338 |
Reduce Array Size to The Half |
Sort, Hash, Heap |
Medium |
C++ |
1339 |
Maximum Product of Splitted Binary Tree |
DFS |
Medium |
C++ |
1342 |
Number of Steps to Reduce a Number to Zero |
Bit |
Easy |
C++ |
1345 |
Jump Game IV |
BFS, Hash |
Hard |
C++ |
1354 |
Construct Target Array With Multiple Sums |
Heap |
Hard |
C++ |
1371 |
Find the Longest Substring Containing Vowels in Even Counts |
Prefix Sum, XOR, Hash |
Medium |
C++ |
1374 |
Generate a String With Characters That Have Odd Counts |
String |
Easy |
C++ |
1383 |
Maximum Performance of a Team |
Greedy, Heap |
Hard |
C++ |
1396 |
Design Underground System |
Hash, Design |
Medium |
C++ |
1402 |
Reducing Dishes |
DP, Greedy |
Hard |
C++ |
1403 |
Minimum Subsequence in Non-Increasing Order |
Greedy |
Easy |
C++ |
1408 |
String Matching in an Array |
String Matching |
Easy |
C++ |
1413 |
Minimum Value to Get Positive Step by Step Sum |
Prefix Sum |
Easy |
C++ |
1417 |
Reformat The String |
String |
Easy |
C++ |
1422 |
Maximum Score After Splitting a String |
String |
Easy |
C++ |
1423 |
Maximum Points You Can Obtain from Cards |
Sliding Window, Prefix |
Medium |
C++ |
1441 |
Build an Array With Stack Operations |
Stack, Simulation |
Medium |
C++ |
1443 |
Minimum Time to Collect All Apples in a Tree |
DFS, BFS, Hash |
Medium |
C++ |
1444 |
Number of Ways of Cutting a Pizza |
DP,Memoization |
Hard |
C++ |
1448 |
Count Good Nodes in Binary Tree |
DFS |
Medium |
C++ |
1450 |
Number of Students Doing Homework at a Given Time |
Interval |
Easy |
C++ |
1455 |
Check If a Word Occurs As a Prefix of Any Word in a Sentence |
String Match |
Easy |
C++ |
1457 |
Pseudo-Palindromic Paths in a Binary Tree |
DFS |
Medium |
C++ |
1460 |
Make Two Arrays Equal by Reversing Sub-arrays |
Hash, Sort |
Easy |
C++ |
1461 |
Check If a String Contains All Binary Codes of Size K |
Bit, Hash |
Medium |
C++ |
1462 |
Course Schedule IV |
Topological Sort |
Medium |
C++ |
1464 |
Maximum Product of Two Elements in an Array |
Array |
Easy |
C++ |
1465 |
Maximum Area of a Piece of Cake After Horizontal and Vertical Cuts |
Greedy |
Medium |
C++ |
1466 |
Reorder Routes to Make All Paths Lead to the City Zero |
DFS, BFS |
Medium |
C++ |
1470 |
Shuffle the Array |
Bit, Two Pointers |
Easy |
C++ |
1472 |
Design Browser History |
Stack, Double Linked List |
Medium |
C++ |
1473 |
Paint House III |
DP |
Hard |
C++ |
1475 |
Final Prices With a Special Discount in a Shop |
Monotonic Stack |
Easy |
C++ |
1478 |
Allocate Mailboxes |
DP, Distance |
Hard |
C++ |
1480 |
Running Sum of 1d Array |
Prefix Sum |
Easy |
C++ |
1487 |
Making File Names Unique |
Hash |
Medium |
C++ |
1514 |
Path with Maximum Probability |
SPFA |
Medium |
C++ |
1519 |
Number of Nodes in the Sub-Tree With the Same Label |
DFS |
Medium |
C++ |
1523 |
Count Odd Numbers in an Interval Range |
Math |
Easy |
C++ |
1531 |
String Compression II |
DP |
Hard |
C++ |
1539 |
Kth Missing Positive Number |
Binary Search |
Easy |
C++ |
1542 |
Find Longest Awesome Substring |
Prefix Sum, XOR, Hash |
Hard |
C++ |
1544 |
Make The String Great |
Stack |
Easy |
C++ |
1574 |
Shortest Subarray to be Removed to Make Array Sorted |
Two Pointers, Binary Search |
Medium |
C++ |
1578 |
Minimum Time to Make Rope Colorful |
Greedy |
Medium |
C++ |
1582 |
Special Positions in a Binary Matrix |
Simulation |
Easy |
C++ |
1584 |
Min Cost to Connect All Points |
Minimum Spanning Tree, Union Find |
Medium |
C++ |
1590 |
Make Sum Divisible by P |
Prefix Sum |
Medium |
C++ |
1592 |
Rearrange Spaces Between Words |
String |
Easy |
C++ |
1598 |
Crawler Log Folder |
Stack, Simulation |
Easy |
C++ |
1599 |
Maximum Profit of Operating a Centennial Wheel |
Simulation |
Medium |
C++ |
1604 |
Alert Using Same Key-Card Three or More Times in a One Hour Period |
Sort, Hash |
Medium |
C++ |
1605 |
Find Valid Matrix Given Row and Column Sums |
Greedy |
Medium |
C++ |
1608 |
Special Array With X Elements Greater Than or Equal X |
Binary Search, Sort |
Easy |
C++ |
1615 |
Maximal Network Rank |
graph |
Medium |
C++ |
1616 |
Split Two Strings to Make Palindrome |
Two Pointers |
Medium |
C++ |
1617 |
Count Subtrees With Max Distance Between Cities |
DP, Bit |
Hard |
C++ |
1619 |
Mean of Array After Removing Some Elements |
Sort |
Easy |
C++ |
1620 |
Coordinate With Maximum Network Quality |
Enumeration |
Medium |
C++ |
1624 |
Largest Substring Between Two Equal Characters |
Hash |
Easy |
C++ |
1625 |
Lexicographically Smallest String After Applying Operations |
BFS, Enumeration |
Medium |
C++ |
1626 |
Best Team With No Conflicts |
DP, Sort |
Medium |
C++ |
1630 |
Arithmetic Subarrays |
Math |
Medium |
C++ |
1631 |
Path With Minimum Effort |
Disjoint Union Set, BFS, DFS, Binary Search |
Medium |
C++ |
1632 |
Rank Transform of a Matrix |
Topological Sort, Union Find |
Hard |
C++ |
1636 |
Sort Array by Increasing Frequency |
Hash, Sort |
Easy |
C++ |
1637 |
Widest Vertical Area Between Two Points Containing No Points |
Sort |
Medium |
C++ |
1638 |
Count Substrings That Differ by One Character |
DP, Hash |
Medium |
C++ |
1640 |
Check Array Formation Through Concatenation |
Hash |
Easy |
C++ |
1641 |
Count Sorted Vowel Strings |
DP |
Medium |
C++ |
1642 |
Furthest Building You Can Reach |
Heap |
Medium |
C++ |
1647 |
Minimum Deletions to Make Character Frequencies Unique |
Greedy |
Medium |
C++ |
1652 |
Defuse the Bomb |
Simulation |
Easy |
C++ |
1653 |
Minimum Deletions to Make String Balanced |
DP, Stack |
Medium |
C++ |
1656 |
Design an Ordered Stream |
Hash |
Easy |
C++ |
1657 |
Determine if Two Strings Are Close |
Hash |
Medium |
C++ |
1658 |
Minimum Operations to Reduce X to Zero |
Prefi9x Sum |
Medium |
C++ |
1662 |
Check If Two String Arrays are Equivalent |
String |
Easy |
C++ |
1663 |
Smallest String With A Given Numeric Value |
Greedy |
Medium |
C++ |
1664 |
Ways to Make a Fair Array |
Prefix Sum, DP |
Medium |
C++ |
1668 |
Maximum Repeating Substring |
DP, Greedy |
Easy |
C++ |
1669 |
Merge In Between Linked Lists |
Linked List |
Medium |
C++ |
1673 |
Find the Most Competitive Subsequence |
Greedy, Monotonic Stack |
Medium |
C++ |
1675 |
Minimize Deviation in Array |
Greedy, Heap |
Hard |
C++ |
1678 |
Goal Parser Interpretation |
String |
Easy |
C++ |
1679 |
Max Number of K-Sum Pairs |
Hash, Two Pointers |
Medium |
C++ |
1680 |
Concatenation of Consecutive Binary Numbers |
Bit |
Medium |
C++ |
1684 |
Count the Number of Consistent Strings |
Hash, Bit |
Easy |
C++ |
1687 |
Delivering Boxes from Storage to Ports |
DP, Segment Tree, Heap |
Hard |
C++ |
1689 |
Partitioning Into Minimum Number Of Deci-Binary Numbers |
Greedy |
Medium |
C++ |
1691 |
Maximum Height by Stacking Cuboids |
DP |
Hard |
C++ |
1694 |
Reformat Phone Number |
String |
Easy |
C++ |
1695 |
Maximum Erasure Value |
Two Pointers |
Medium |
C++ |
1696 |
Jump Game VI |
DP, Monotonic Stack, Heap |
Medium |
C++ |
1697 |
Checking Existence of Edge Length Limited Paths |
Union Find, Sort |
Hard |
C++ |
1700 |
Number of Students Unable to Eat Lunch |
Simulation |
Easy |
C++ |
1703 |
Minimum Adjacent Swaps for K Consecutive Ones |
Math, Distance |
Hard |
C++ |
1704 |
Determine if String Halves Are Alike |
Counting |
Easy |
C++ |
1706 |
Where Will the Ball Fall |
Simulation, DP, DFS |
Medium |
C++ |
1710 |
Maximum Units on a Truck |
Greedy |
Easy |
C++ |
1732 |
Find the Highest Altitude |
Prefix Sum |
Easy |
C++ |
1739 |
Building Boxes |
Math, Greedy |
Hard |
C++ |
1742 |
Maximum Number of Balls in a Box |
Simulation |
Easy |
C++ |
1750 |
Minimum Length of String After Deleting Similar Ends |
Two Pointers |
Medium |
C++ |
1751 |
Maximum Number of Events That Can Be Attended II |
Binary Search, Interval |
Hard |
C++ |
1752 |
Check if Array Is Sorted and Rotated |
Array |
Easy |
C++ |
1753 |
Maximum Score From Removing Stones |
Greedy, Math |
Medium |
C++ |
1754 |
Largest Merge Of Two Strings |
Two Pointers, Greedy |
Medium |
C++ |
1755 |
Closest Subsequence Sum |
Bit Mask, Two Parts |
Hard |
C++ |
1758 |
Minimum Changes To Make Alternating Binary String |
String |
Easy |
C++ |
1759 |
Count Number of Homogenous Substrings |
String |
Medium |
C++ |
1760 |
Minimum Limit of Balls in a Bag |
Binary Search |
Medium |
C++ |
1764 |
Form Array by Concatenating Subarrays of Another Array |
String Matching, Greedy |
Medium |
C++ |
1768 |
Merge Strings Alternately |
Two Pointers |
Easy |
C++ |
1769 |
Minimum Number of Operations to Move All Balls to Each Box |
Prefix Sum |
Medium |
C++ |
1770 |
Maximum Score from Performing Multiplication Operations |
DP |
Medium |
C++ |
1773 |
Count Items Matching a Rule |
String |
Easy |
C++ |
1774 |
Closest Dessert Cost |
Backtracking, DP |
Medium |
C++ |
1775 |
Equal Sum Arrays With Minimum Number of Operations |
Hash, Greedy |
Medium |
C++ |
1779 |
Find Nearest Point That Has the Same X or Y Coordinate |
Array |
Easy |
C++ |
1780 |
Check if Number is a Sum of Powers of Three |
Math |
Medium |
C++ |
1781 |
Sum of Beauty of All Substrings |
Hash |
Medium |
C++ |
1784 |
Check if Binary String Has at Most One Segment of Ones |
Simulation |
Easy |
C++ |
1785 |
Minimum Elements to Add to Form a Given Sum |
Greedy |
Medium |
C++ |
1790 |
Check if One String Swap Can Make Strings Equal |
Simulation |
Easy |
C++ |
1792 |
Maximum Average Pass Ratio |
Heap |
Medium |
C++ |
1796 |
Second Largest Digit in a String |
Hash |
Easy |
C++ |
1797 |
Design Authentication Manager |
Hash |
Medium |
C++ |
1798 |
Maximum Number of Consecutive Values You Can Make |
Greedy |
Medium |
C++ |
1799 |
Maximize Score After N Operations |
DP, Bit |
Hard |
C++ |
1800 |
Maximum Ascending Subarray Sum |
DP |
Easy |
C++ |
1801 |
Number of Orders in the Backlog |
Heap |
Medium |
C++ |
1802 |
Maximum Value at a Given Index in a Bounded Array |
Binary Search |
Medium |
C++ |
1803 |
Count Pairs With XOR in a Range |
Trie |
Hard |
C++ |
1805 |
Number of Different Integers in a String |
Hash |
Easy |
C++ |
1806 |
Minimum Number of Operations to Reinitialize a Permutation |
Math, Simulation |
Medium |
C++ |
1807 |
Evaluate the Bracket Pairs of a String |
Hash |
Medium |
C++ |
1812 |
Determine Color of a Chessboard Square |
Math |
Easy |
C++ |
1813 |
Sentence Similarity III |
Two Pointers |
Medium |
C++ |
1814 |
Count Nice Pairs in an Array |
Hash |
Medium |
C++ |
1815 |
Maximum Number of Groups Getting Fresh Donuts |
DP, Greedy, Bit |
Hard |
C++ |
1817 |
Finding the Users Active Minutes |
Hash |
Medium |
C++ |
1818 |
Minimum Absolute Sum Difference |
Binary Search |
Medium |
C++ |
1819 |
Number of Different Subsequences GCDs |
Math |
Hard |
C++ |
1822 |
Sign of the Product of an Array |
Array |
Easy |
C++ |
1824 |
Minimum Sideway Jumps |
DP, Greedy |
Medium |
C++ |
1825 |
Finding MK Average |
Queue, Heap, Ordered Set |
Hard |
C++ |
1827 |
Minimum Operations to Make the Array Increasing |
Greedy |
Easy |
C++ |
1828 |
Queries on Number of Points Inside a Circle |
Math |
Medium |
C++ |
1832 |
Check if the Sentence Is Pangram |
Hash |
Easy |
C++ |
1833 |
Maximum Ice Cream Bars |
Greedy |
Medium |
C++ |
1834 |
Single-Threaded CPU |
Heap |
Medium |
C++ |
1857 |
Largest Color Value in a Directed Graph |
DP, Topological Sort |
Hard |
C++ |
1870 |
Minimum Speed to Arrive on Time |
Binary Search |
Medium |
C++ |
1918* |
Kth Smallest Subarray Sum lintcode |
Binary Search |
Medium |
C++ |
1926 |
Nearest Exit from Entrance in Maze |
BFS |
Medium |
C++ |
1945 |
Sum of Digits of String After Convert |
Simulation |
Easy |
C++ |
1962 |
Remove Stones to Minimize the Total |
Heap |
Medium |
C++ |
1971 |
Find if Path Exists in Graph |
BFS, DFS, Union Find |
Easy |
C++ |
1996 |
The Number of Weak Characters in the Game |
Greedy, Sort, Monotonic Stack |
Medium |
C++ |
2007 |
Find Original Array From Doubled Array |
Hash, Greedy, Sort |
Medium |
C++ |
2008 |
Maximum Earnings From Taxi |
Binary Search, Interval |
Medium |
C++ |
2011 |
Final Value of Variable After Performing Operations |
String |
Easy |
C++ |
2024 |
Maximize the Confusion of an Exam |
Two Pointers, Prefix um |
Medium |
C++ |
2027 |
Minimum Moves to Convert String |
Greedy |
Easy |
C++ |
2029 |
Stone Game IX |
Greedy, Game Theory |
Medium |
C++ |
2030 |
Smallest K-Length Subsequence With Occurrences of a Letter |
Greedy, Monotonic Stack |
Hard |
C++ |
2032 |
Two Out of Three |
Hash |
Easy |
C++ |
2033 |
Minimum Operations to Make a Uni-Value Grid |
Math |
Medium |
C++ |
2035 |
Partition Array Into Two Arrays to Minimize Sum Difference |
Bit Mask, Two Parts |
Hard |
C++ |
2037 |
Minimum Number of Moves to Seat Everyone |
Greedy, Sort |
Easy |
C++ |
2040 |
Kth Smallest Product of Two Sorted Arrays |
Binary Search |
Hard |
C++ |
2042 |
Check if Numbers Are Ascending in a Sentence |
String |
Easy |
C++ |
2044 |
Count Number of Maximum Bitwise-OR Subsets |
Dynamic Programming |
Medium |
C++ |
2045 |
Second Minimum Time to Reach Destination |
BFS |
Hard |
C++ |
2049 |
Count Nodes With the Highest Score |
Binary Tree |
Medium |
C++ |
2050 |
Parallel Courses III |
Topological Sort |
Hard |
C++ |
2054 |
Two Best Non-Overlapping Events |
Heap, Greedy, Interval |
Medium |
C++ |
2055 |
Plates Between Candles |
Greedy, State Machine, Prefix Sum |
Medium |
C++ |
2056 |
Number of Valid Move Combinations On Chessboard |
DFS |
Hard |
C++ |
2060 |
Check if an Original String Exists Given Two Encoded Strings |
Recursion |
Hard |
C++ |
2064 |
Minimized Maximum of Products Distributed to Any Store |
Binary Search |
Medium |
C++ |
2065 |
Maximum Path Quality of a Graph |
DFS |
Hard |
C++ |
2095 |
Delete the Middle Node of a Linked List |
Two Pointers |
Medium |
C++ |
2131 |
Longest Palindrome by Concatenating Two Letter Words |
Hash, Greedy |
Medium |
C++ |
2136 |
Earliest Possible Day of Full Bloom |
Greedy |
Hard |
C++ |
2180 |
Count Integers With Even Digit Sum |
Simulation, Math |
Easy |
C++ |
2185 |
Counting Words With a Given Prefix |
String |
Easy |
C++ |
2187 |
Minimum Time to Complete Trips |
Binary Search |
Medium |
C++ |
2218 |
Maximum Value of K Coins From Piles |
DP, Prefix Sum |
Hard |
C++ |
2225 |
Find Players With Zero or One Losses |
Hash |
Medium |
C++ |
2244 |
Minimum Rounds to Complete All Tasks |
Greedy, Hash |
Medium |
C++ |
2246 |
Longest Path With Different Adjacent Characters |
DFS, Topological Sort |
Hard |
C++ |
2256 |
Minimum Average Difference |
Prefix Sum |
Medium |
C++ |
2279 |
Maximum Bags With Full Capacity of Rocks |
Greedy |
Medium |
C++ |
2283 |
Check if Number Has Equal Digit Count and Digit Value |
Hash |
Easy |
C++ |
2287 |
Rearrange Characters to Make Target String |
Hash |
Easy |
C++ |
2293 |
Min Max Game |
Simulation |
Easy |
C++ |
2299 |
Strong Password Checker II |
String |
Easy |
C++ |
2300 |
Successful Pairs of Spells and Potions |
Binary Search |
Medium |
C++ |
2303 |
Calculate Amount Paid in Taxes |
Simulation |
Easy |
C++ |
2306 |
Naming a Company |
Hash, Bit, Enumeration |
Hard |
C++ |
2309 |
Greatest English Letter in Upper and Lower Case |
Hash |
Easy |
C++ |
2315 |
Count Asterisks |
String |
Easy |
C++ |
2316 |
Count Unreachable Pairs of Nodes in an Undirected Graph |
BFS, DFS, Union Find |
Medium |
C++ |
2319 |
Check if Matrix Is X-Matrix |
Matrix |
Easy |
C++ |
2325 |
Decode the Message |
Hash |
Easy |
C++ |
2331 |
Evaluate Boolean Binary Tree |
DFS |
Easy |
C++ |
2335 |
Minimum Amount of Time to Fill Cups |
Greedy |
Easy |
C++ |
2336 |
Smallest Number in Infinite Set |
Heap |
Medium |
C++ |
2337 |
Move Pieces to Obtain a String |
Two Pointers |
Medium |
C++ |
2341 |
Maximum Number of Pairs in Array |
Hash |
Easy |
C++ |
2347 |
Best Poker Hand |
Hash |
Easy |
C++ |
2348 |
Number of Zero-Filled Subarrays |
Math |
Medium |
C++ |
2351 |
First Letter to Appear Twice |
Hash, Count |
Easy |
C++ |
2352 |
Equal Row and Column Pairs |
Hash, Simulation |
Medium |
C++ |
2353 |
Design a Food Rating System |
Hash, Ordered Set, Heap |
Medium |
C++ |
2354 |
Number of Excellent Pairs |
Bit, Binary Search, Prefix Sum |
Hard |
C++ |
2357 |
Make Array Zero by Subtracting Equal Amounts |
Hash |
Easy |
C++ |
2359 |
Find Closest Node to Given Two Nodes |
DFS |
Medium |
C++ |
2360 |
Longest Cycle in a Graph |
DFS, Topological Sort |
Hard |
C++ |
2363 |
Merge Similar Items |
Hash, Ordered Set |
Easy |
C++ |
2367 |
Number of Arithmetic Triplets |
Hash, Two Pointers |
Easy |
C++ |
2373 |
Largest Local Values in a Matrix |
Matrix |
Easy |
C++ |
2376 |
Count Special Integers |
DP, Combinatorics |
Hard |
C++ |
2379 |
Minimum Recolors to Get K Consecutive Black Blocks |
Sliding Window |
Easy |
C++ |
2383 |
Minimum Hours of Training to Win a Competition |
Greedy |
Easy |
C++ |
2389 |
Longest Subsequence With Limited Sum |
Binary Search, Prefix Sum |
Easy |
C++ |
2390 |
Removing Stars From a String |
Stack |
Medium |
C++ |
2395 |
Find Subarrays With Equal Sum |
Hash |
Easy |
C++ |
2397 |
Maximum Rows Covered by Columns |
Bit |
Medium |
C++ |
2399 |
Check Distances Between Same Letters |
Hash |
Easy |
C++ |
2402 |
Meeting Rooms III |
Heap |
Hard |
C++ |
2404 |
Most Frequent Even Element |
Hash |
Easy |
C++ |
2405 |
Optimal Partition of String |
Hash |
Medium |
C++ |
2406 |
Divide Intervals Into Minimum Number of Groups |
Greedy, Heap |
Medium |
C++ |
2421 |
Number of Good Paths |
Union Find |
Hard |
C++ |
2427 |
Number of Common Factors |
Math |
Easy |
C++ |
2434 |
Using a Robot to Print the Lexicographically Smallest String |
Stack, Greedy |
Medium |
C++ |
2435 |
Paths in Matrix Whose Sum Is Divisible by K |
DP |
Hard |
C++ |
2439 |
Minimize Maximum of Array |
DP, Greedy, Binary Search |
Medium |
C++ |
2444 |
Count Subarrays With Fixed Bounds |
Two Pointers |
Hard |
C++ |
2447 |
Number of Subarrays With GCD Equal to K |
Math |
Medium |
C++ |
2448 |
Minimum Cost to Make Array Equal |
Math |
Hard |
C++ |
2463 |
Minimum Total Distance Traveled |
DP |
Hard |
C++ |
2469 |
Convert the Temperature |
Math |
Easy |
C++ |
2477 |
Minimum Fuel Cost to Report to the Capital |
BFS, DFS |
Medium |
C++ |
2478 |
Number of Beautiful Partitions |
DP |
Hard |
C++ |
2488 |
Count Subarrays With Median K |
Prefix Sum, Hash |
Hard |
C++ |
2492 |
Minimum Score of a Path Between Two Cities |
BFS, DFS, Union Find |
Medium |
C++ |
2493 |
Divide Nodes Into the Maximum Number of Groups |
Bipartite, DFS, BFS |
Hard |
C++ |
2503 |
Maximum Number of Points From Grid Queries |
Heap, Union Find, BFS |
Hard |
C++ |
2508 |
Add Edges to Make Degrees of All Nodes Even |
Math |
Hard |
C++ |
2516 |
Take K of Each Character From Left and Right |
Two Pointers |
Medium |
C++ |
2517 |
Maximum Tastiness of Candy Basket |
Binary Search |
Medium |
C++ |
2528 |
Maximize the Minimum Powered City |
Binary Search, Greedy, Difference Array |
Hard |
C++ |
2532 |
Time to Cross a Bridge |
Heap, Simulation |
Hard |
C++ |
2538 |
Difference Between Maximum and Minimum Price Sum |
DFS, DP |
Hard |
C++ |
2552 |
Count Increasing Quadruplets |
DP, Binary Indexed Tree, Enumeration, Prefix Sum |
Hard |
C++ |
2560 |
House Robber IV |
DP, Binary Search |
Medium |
C++ |
2561 |
Rearranging Fruits |
Greedy, Hash |
Hard |
C++ |
2565 |
Subsequence With the Minimum Score |
Prefix, Suffix |
Hard |
C++ |
2573 |
Find the String with LCP |
Greedy, DP |
Hard |
C++ |
2576 |
Find the Maximum Number of Marked Indices |
Binary Search, Greedy, Two Pointers |
Medium |
C++ |
2585 |
Number of Ways to Earn Points |
DP |
Hard |
C++ |
2597 |
The Number of Beautiful Subsets |
DP, Backtracking |
Medium |
C++ |
2603 |
Collect Coins in a Tree |
Topological Sort, DP |
Hard |
C++ |
2607 |
Make K-Subarray Sums Equal |
Bézout's lemma, Greedy |
Medium |
C++ |