leetcode列表分类

1、leetcode题目列表

No. Title Solution Acceptance Difficulty Frequency
0001 Two Sum Go 46.6% Easy
0002 Add Two Numbers Go 35.6% Medium
0003 Longest Substring Without Repeating Characters Go 31.5% Medium
0004 Median of Two Sorted Arrays Go 31.2% Hard
0005 Longest Palindromic Substring Go 30.6% Medium
0006 ZigZag Conversion Go 38.1% Medium
0007 Reverse Integer Go 25.9% Easy
0008 String to Integer (atoi) Go 15.7% Medium
0009 Palindrome Number Go 49.9% Easy
0010 Regular Expression Matching 27.4% Hard
0011 Container With Most Water Go 52.8% Medium
0012 Integer to Roman Go 57.0% Medium
0013 Roman to Integer Go 56.9% Easy
0014 Longest Common Prefix 36.2% Easy
0015 3Sum Go 28.2% Medium
0016 3Sum Closest Go 46.3% Medium
0017 Letter Combinations of a Phone Number Go 49.4% Medium
0018 4Sum Go 35.0% Medium
0019 Remove Nth Node From End of List Go 35.8% Medium
0020 Valid Parentheses Go 39.9% Easy
0021 Merge Two Sorted Lists Go 56.2% Easy
0022 Generate Parentheses Go 65.5% Medium
0023 Merge k Sorted Lists Go 42.9% Hard
0024 Swap Nodes in Pairs Go 53.3% Medium
0025 Reverse Nodes in k-Group Go 45.1% Hard
0026 Remove Duplicates from Sorted Array Go 46.7% Easy
0027 Remove Element Go 49.4% Easy
0028 Implement strStr() Go 35.3% Easy
0029 Divide Two Integers Go 16.9% Medium
0030 Substring with Concatenation of All Words Go 26.3% Hard
0031 Next Permutation Go 33.8% Medium
0032 Longest Valid Parentheses 29.4% Hard
0033 Search in Rotated Sorted Array Go 36.0% Medium
0034 Find First and Last Position of Element in Sorted Array Go 37.4% Medium
0035 Search Insert Position Go 42.8% Easy
0036 Valid Sudoku Go 50.7% Medium
0037 Sudoku Solver Go 46.8% Hard
0038 Count and Say 46.2% Medium
0039 Combination Sum Go 59.5% Medium
0040 Combination Sum II Go 50.3% Medium
0041 First Missing Positive Go 33.8% Hard
0042 Trapping Rain Water Go 51.4% Hard
0043 Multiply Strings Go 35.0% Medium
0044 Wildcard Matching 25.5% Hard
0045 Jump Game II Go 31.5% Medium
0046 Permutations Go 66.9% Medium
0047 Permutations II Go 49.6% Medium
0048 Rotate Image Go 60.2% Medium
0049 Group Anagrams Go 59.5% Medium
0050 Pow(x, n) Go 31.0% Medium
0051 N-Queens Go 49.9% Hard
0052 N-Queens II Go 60.4% Hard
0053 Maximum Subarray Go 47.8% Easy
0054 Spiral Matrix Go 36.3% Medium
0055 Jump Game Go 35.2% Medium
0056 Merge Intervals Go 41.2% Medium
0057 Insert Interval Go 35.2% Medium
0058 Length of Last Word 33.5% Easy
0059 Spiral Matrix II Go 58.0% Medium
0060 Permutation Sequence Go 39.5% Hard
0061 Rotate List Go 31.9% Medium
0062 Unique Paths Go 56.2% Medium
0063 Unique Paths II Go 35.3% Medium
0064 Minimum Path Sum Go 56.4% Medium
0065 Valid Number 16.0% Hard
0066 Plus One Go 42.3% Easy
0067 Add Binary Go 47.1% Easy
0068 Text Justification 29.9% Hard
0069 Sqrt(x) Go 35.2% Easy
0070 Climbing Stairs Go 48.7% Easy
0071 Simplify Path Go 34.8% Medium
0072 Edit Distance 46.9% Hard
0073 Set Matrix Zeroes Go 44.4% Medium
0074 Search a 2D Matrix Go 38.0% Medium
0075 Sort Colors Go 49.6% Medium
0076 Minimum Window Substring Go 36.1% Hard
0077 Combinations Go 57.7% Medium
0078 Subsets Go 65.4% Medium
0079 Word Search Go 37.0% Medium
0080 Remove Duplicates from Sorted Array II Go 46.2% Medium
0081 Search in Rotated Sorted Array II Go 33.6% Medium
0082 Remove Duplicates from Sorted List II Go 39.4% Medium
0083 Remove Duplicates from Sorted List Go 46.6% Easy
0084 Largest Rectangle in Histogram Go 37.3% Hard
0085 Maximal Rectangle 39.6% Hard
0086 Partition List Go 43.6% Medium
0087 Scramble String 34.8% Hard
0088 Merge Sorted Array Go 40.8% Easy
0089 Gray Code Go 50.6% Medium
0090 Subsets II Go 49.0% Medium
0091 Decode Ways Go 26.7% Medium
0092 Reverse Linked List II Go 40.7% Medium
0093 Restore IP Addresses Go 37.7% Medium
0094 Binary Tree Inorder Traversal Go 66.1% Medium
0095 Unique Binary Search Trees II Go 42.8% Medium
0096 Unique Binary Search Trees Go 54.6% Medium
0097 Interleaving String 32.7% Hard
0098 Validate Binary Search Tree Go 28.8% Medium
0099 Recover Binary Search Tree Go 42.6% Hard
0100 Same Tree Go 54.2% Easy
0101 Symmetric Tree Go 48.3% Easy
0102 Binary Tree Level Order Traversal Go 56.8% Medium
0103 Binary Tree Zigzag Level Order Traversal Go 50.3% Medium
0104 Maximum Depth of Binary Tree Go 68.2% Easy
0105 Construct Binary Tree from Preorder and Inorder Traversal Go 52.1% Medium
0106 Construct Binary Tree from Inorder and Postorder Traversal Go 49.9% Medium
0107 Binary Tree Level Order Traversal II Go 55.4% Medium
0108 Convert Sorted Array to Binary Search Tree Go 60.7% Easy
0109 Convert Sorted List to Binary Search Tree Go 50.4% Medium
0110 Balanced Binary Tree Go 44.8% Easy
0111 Minimum Depth of Binary Tree Go 39.7% Easy
0112 Path Sum Go 42.5% Easy
0113 Path Sum II Go 49.3% Medium
0114 Flatten Binary Tree to Linked List Go 52.2% Medium
0115 Distinct Subsequences Go 39.9% Hard
0116 Populating Next Right Pointers in Each Node 49.4% Medium
0117 Populating Next Right Pointers in Each Node II 42.3% Medium
0118 Pascal’s Triangle Go 55.2% Easy
0119 Pascal’s Triangle II Go 52.4% Easy
0120 Triangle Go 45.9% Medium
0121 Best Time to Buy and Sell Stock Go 51.7% Easy
0122 Best Time to Buy and Sell Stock II Go 58.7% Easy
0123 Best Time to Buy and Sell Stock III 40.1% Hard
0124 Binary Tree Maximum Path Sum Go 35.6% Hard
0125 Valid Palindrome Go 38.4% Easy
0126 Word Ladder II Go 23.9% Hard
0127 Word Ladder Go 32.0% Hard
0128 Longest Consecutive Sequence Go 46.4% Hard
0129 Sum Root to Leaf Numbers Go 51.1% Medium
0130 Surrounded Regions Go 29.6% Medium
0131 Palindrome Partitioning Go 52.4% Medium
0132 Palindrome Partitioning II 31.4% Hard
0133 Clone Graph 39.5% Medium
0134 Gas Station 41.4% Medium
0135 Candy 33.2% Hard
0136 Single Number Go 66.6% Easy
0137 Single Number II Go 54.0% Medium
0138 Copy List with Random Pointer Go 41.2% Medium
0139 Word Break 41.8% Medium
0140 Word Break II 35.0% Hard
0141 Linked List Cycle Go 43.0% Easy
0142 Linked List Cycle II Go 39.9% Medium
0143 Reorder List Go 40.8% Medium
0144 Binary Tree Preorder Traversal Go 57.7% Medium
0145 Binary Tree Postorder Traversal Go 57.8% Medium
0146 LRU Cache Go 36.0% Medium
0147 Insertion Sort List Go 44.5% Medium
0148 Sort List Go 46.5% Medium
0149 Max Points on a Line 17.5% Hard
0150 Evaluate Reverse Polish Notation Go 38.1% Medium
0151 Reverse Words in a String Go 24.0% Medium
0152 Maximum Product Subarray Go 32.8% Medium
0153 Find Minimum in Rotated Sorted Array Go 46.3% Medium
0154 Find Minimum in Rotated Sorted Array II Go 42.1% Hard
0155 Min Stack Go 46.6% Easy
0156 Binary Tree Upside Down 56.5% Medium
0157 Read N Characters Given Read4 37.5% Easy
0158 Read N Characters Given Read4 II - Call multiple times 37.1% Hard
0159 Longest Substring with At Most Two Distinct Characters 50.6% Medium
0160 Intersection of Two Linked Lists Go 44.3% Easy
0161 One Edit Distance 33.1% Medium
0162 Find Peak Element Go 44.0% Medium
0163 Missing Ranges 27.2% Easy
0164 Maximum Gap Go 37.0% Hard
0165 Compare Version Numbers 30.5% Medium
0166 Fraction to Recurring Decimal 22.4% Medium
0167 Two Sum II - Input array is sorted Go 55.7% Easy
0168 Excel Sheet Column Title Go 31.8% Easy
0169 Majority Element Go 60.1% Easy
0170 Two Sum III - Data structure design 35.0% Easy
0171 Excel Sheet Column Number Go 57.0% Easy
0172 Factorial Trailing Zeroes Go 38.7% Easy
0173 Binary Search Tree Iterator Go 60.4% Medium
0174 Dungeon Game Go 33.4% Hard
0175 Combine Two Tables 64.5% Easy
0176 Second Highest Salary 33.4% Easy
0177 Nth Highest Salary 33.4% Medium
0178 Rank Scores 50.6% Medium
0179 Largest Number Go 30.8% Medium
0180 Consecutive Numbers 42.4% Medium
0181 Employees Earning More Than Their Managers 60.7% Easy
0182 Duplicate Emails 64.8% Easy
0183 Customers Who Never Order 57.2% Easy
0184 Department Highest Salary 40.5% Medium
0185 Department Top Three Salaries 39.4% Hard
0186 Reverse Words in a String II 45.8% Medium
0187 Repeated DNA Sequences Go 41.6% Medium
0188 Best Time to Buy and Sell Stock IV 29.9% Hard
0189 Rotate Array Go 36.7% Medium
0190 Reverse Bits Go 42.4% Easy
0191 Number of 1 Bits Go 54.0% Easy
0192 Word Frequency 25.6% Medium
0193 Valid Phone Numbers 25.4% Easy
0194 Transpose File 24.4% Medium
0195 Tenth Line 32.8% Easy
0196 Delete Duplicate Emails 45.6% Easy
0197 Rising Temperature 40.1% Easy
0198 House Robber Go 43.0% Medium
0199 Binary Tree Right Side View Go 56.4% Medium
0200 Number of Islands Go 49.3% Medium
0201 Bitwise AND of Numbers Range Go 39.7% Medium
0202 Happy Number Go 51.3% Easy
0203 Remove Linked List Elements Go 39.3% Easy
0204 Count Primes Go 32.3% Easy
0205 Isomorphic Strings Go 40.5% Easy
0206 Reverse Linked List Go 65.5% Easy
0207 Course Schedule Go 44.3% Medium
0208 Implement Trie (Prefix Tree) Go 52.3% Medium
0209 Minimum Size Subarray Sum Go 39.6% Medium
0210 Course Schedule II Go 42.8% Medium
0211 Design Add and Search Words Data Structure Go 40.4% Medium
0212 Word Search II Go 37.3% Hard
0213 House Robber II Go 37.6% Medium
0214 Shortest Palindrome 30.7% Hard
0215 Kth Largest Element in an Array Go 58.7% Medium
0216 Combination Sum III Go 60.5% Medium
0217 Contains Duplicate Go 56.7% Easy
0218 The Skyline Problem Go 36.5% Hard
0219 Contains Duplicate II Go 38.7% Easy
0220 Contains Duplicate III Go 21.3% Medium
0221 Maximal Square 39.4% Medium
0222 Count Complete Tree Nodes Go 49.5% Medium
0223 Rectangle Area Go 38.3% Medium
0224 Basic Calculator Go 38.2% Hard
0225 Implement Stack using Queues Go 47.7% Easy
0226 Invert Binary Tree Go 67.2% Easy
0227 Basic Calculator II Go 38.6% Medium
0228 Summary Ranges Go 42.6% Easy
0229 Majority Element II Go 38.9% Medium
0230 Kth Smallest Element in a BST Go 62.8% Medium
0231 Power of Two Go 43.8% Easy
0232 Implement Queue using Stacks Go 52.5% Easy
0233 Number of Digit One 31.8% Hard
0234 Palindrome Linked List Go 40.8% Easy
0235 Lowest Common Ancestor of a Binary Search Tree Go 51.9% Easy
0236 Lowest Common Ancestor of a Binary Tree Go 49.1% Medium
0237 Delete Node in a Linked List Go 67.2% Easy
0238 Product of Array Except Self 61.4% Medium
0239 Sliding Window Maximum Go 44.7% Hard
0240 Search a 2D Matrix II Go 45.2% Medium
0241 Different Ways to Add Parentheses 57.4% Medium
0242 Valid Anagram Go 58.7% Easy
0243 Shortest Word Distance 62.0% Easy
0244 Shortest Word Distance II 54.3% Medium
0245 Shortest Word Distance III 56.0% Medium
0246 Strobogrammatic Number 46.4% Easy
0247 Strobogrammatic Number II 48.6% Medium
0248 Strobogrammatic Number III 40.3% Hard
0249 Group Shifted Strings 58.3% Medium
0250 Count Univalue Subtrees 53.4% Medium
0251 Flatten 2D Vector 46.4% Medium
0252 Meeting Rooms 55.5% Easy
0253 Meeting Rooms II 47.0% Medium
0254 Factor Combinations 47.5% Medium
0255 Verify Preorder Sequence in Binary Search Tree 46.3% Medium
0256 Paint House 53.8% Medium
0257 Binary Tree Paths Go 53.8% Easy
0258 Add Digits Go 58.6% Easy
0259 3Sum Smaller 49.1% Medium
0260 Single Number III Go 65.4% Medium
0261 Graph Valid Tree 43.3% Medium
0262 Trips and Users 35.3% Hard
0263 Ugly Number Go 41.7% Easy
0264 Ugly Number II 42.9% Medium
0265 Paint House II 45.7% Hard
0266 Palindrome Permutation 62.5% Easy
0267 Palindrome Permutation II 37.5% Medium
0268 Missing Number Go 55.0% Easy
0269 Alien Dictionary 33.8% Hard
0270 Closest Binary Search Tree Value 50.1% Easy
0271 Encode and Decode Strings 32.9% Medium
0272 Closest Binary Search Tree Value II 52.5% Hard
0273 Integer to English Words 28.2% Hard
0274 H-Index Go 36.4% Medium
0275 H-Index II Go 36.3% Medium
0276 Paint Fence 39.1% Medium
0277 Find the Celebrity 43.9% Medium
0278 First Bad Version 37.6% Easy
0279 Perfect Squares 49.1% Medium
0280 Wiggle Sort 64.7% Medium
0281 Zigzag Iterator 59.5% Medium
0282 Expression Add Operators 36.8% Hard
0283 Move Zeroes Go 58.6% Easy
0284 Peeking Iterator Go 50.8% Medium
0285 Inorder Successor in BST 43.1% Medium
0286 Walls and Gates 56.7% Medium
0287 Find the Duplicate Number Go 57.7% Medium
0288 Unique Word Abbreviation 23.1% Medium
0289 Game of Life 58.5% Medium
0290 Word Pattern Go 38.4% Easy
0291 Word Pattern II 44.3% Medium
0292 Nim Game 55.1% Easy
0293 Flip Game 61.4% Easy
0294 Flip Game II 50.7% Medium
0295 Find Median from Data Stream 47.2% Hard
0296 Best Meeting Point 58.1% Hard
0297 Serialize and Deserialize Binary Tree 50.0% Hard
0298 Binary Tree Longest Consecutive Sequence 48.1% Medium
0299 Bulls and Cows 44.6% Medium
0300 Longest Increasing Subsequence Go 44.3% Medium
0301 Remove Invalid Parentheses 44.8% Hard
0302 Smallest Rectangle Enclosing Black Pixels 52.5% Hard
0303 Range Sum Query - Immutable Go 47.9% Easy
0304 Range Sum Query 2D - Immutable Go 40.7% Medium
0305 Number of Islands II 39.6% Hard
0306 Additive Number Go 29.7% Medium
0307 Range Sum Query - Mutable Go 36.8% Medium
0308 Range Sum Query 2D - Mutable 37.9% Hard
0309 Best Time to Buy and Sell Stock with Cooldown Go 48.3% Medium
0310 Minimum Height Trees 34.8% Medium
0311 Sparse Matrix Multiplication 64.1% Medium
0312 Burst Balloons 53.8% Hard
0313 Super Ugly Number 46.3% Medium
0314 Binary Tree Vertical Order Traversal 47.1% Medium
0315 Count of Smaller Numbers After Self Go 42.4% Hard
0316 Remove Duplicate Letters 39.2% Medium
0317 Shortest Distance from All Buildings 42.8% Hard
0318 Maximum Product of Word Lengths Go 52.4% Medium
0319 Bulb Switcher 45.4% Medium
0320 Generalized Abbreviation 53.9% Medium
0321 Create Maximum Number 27.6% Hard
0322 Coin Change Go 37.6% Medium
0323 Number of Connected Components in an Undirected Graph 58.0% Medium
0324 Wiggle Sort II Go 30.8% Medium
0325 Maximum Size Subarray Sum Equals k 47.5% Medium
0326 Power of Three Go 42.1% Easy
0327 Count of Range Sum Go 36.1% Hard
0328 Odd Even Linked List Go 57.2% Medium
0329 Longest Increasing Path in a Matrix Go 45.1% Hard
0330 Patching Array 35.0% Hard
0331 Verify Preorder Serialization of a Binary Tree Go 41.1% Medium
0332 Reconstruct Itinerary 38.0% Medium
0333 Largest BST Subtree 38.1% Medium
0334 Increasing Triplet Subsequence 40.8% Medium
0335 Self Crossing 28.7% Hard
0336 Palindrome Pairs 34.7% Hard
0337 House Robber III Go 52.0% Medium
0338 Counting Bits Go 70.5% Medium
0339 Nested List Weight Sum 76.6% Medium
0340 Longest Substring with At Most K Distinct Characters 45.6% Medium
0341 Flatten Nested List Iterator 54.7% Medium
0342 Power of Four Go 41.8% Easy
0343 Integer Break Go 51.3% Medium
0344 Reverse String Go 70.5% Easy
0345 Reverse Vowels of a String Go 45.1% Easy
0346 Moving Average from Data Stream 73.4% Easy
0347 Top K Frequent Elements Go 62.5% Medium
0348 Design Tic-Tac-Toe 55.7% Medium
0349 Intersection of Two Arrays Go 65.0% Easy
0350 Intersection of Two Arrays II Go 52.0% Easy
0351 Android Unlock Patterns 49.8% Medium
0352 Data Stream as Disjoint Intervals 48.7% Hard
0353 Design Snake Game 36.0% Medium
0354 Russian Doll Envelopes Go 36.5% Hard
0355 Design Twitter 31.5% Medium
0356 Line Reflection 33.0% Medium
0357 Count Numbers with Unique Digits Go 48.9% Medium
0358 Rearrange String k Distance Apart 35.7% Hard
0359 Logger Rate Limiter 72.4% Easy
0360 Sort Transformed Array 49.8% Medium
0361 Bomb Enemy 46.8% Medium
0362 Design Hit Counter 65.4% Medium
0363 Max Sum of Rectangle No Larger Than K 38.5% Hard
0364 Nested List Weight Sum II 63.8% Medium
0365 Water and Jug Problem 31.2% Medium
0366 Find Leaves of Binary Tree 72.0% Medium
0367 Valid Perfect Square Go 42.1% Easy
0368 Largest Divisible Subset 38.4% Medium
0369 Plus One Linked List 59.6% Medium
0370 Range Addition 63.6% Medium
0371 Sum of Two Integers Go 50.6% Medium
0372 Super Pow Go 36.7% Medium
0373 Find K Pairs with Smallest Sums Go 37.8% Medium
0374 Guess Number Higher or Lower 44.8% Easy
0375 Guess Number Higher or Lower II 42.3% Medium
0376 Wiggle Subsequence Go 42.2% Medium
0377 Combination Sum IV 46.1% Medium
0378 Kth Smallest Element in a Sorted Matrix Go 56.3% Medium
0379 Design Phone Directory 48.4% Medium
0380 Insert Delete GetRandom O(1) 49.0% Medium
0381 Insert Delete GetRandom O(1) - Duplicates allowed 34.9% Hard
0382 Linked List Random Node 54.2% Medium
0383 Ransom Note 53.4% Easy
0384 Shuffle an Array 54.1% Medium
0385 Mini Parser Go 34.5% Medium
0386 Lexicographical Numbers Go 54.4% Medium
0387 First Unique Character in a String Go 53.8% Easy
0388 Longest Absolute File Path 43.0% Medium
0389 Find the Difference Go 57.9% Easy
0390 Elimination Game 45.1% Medium
0391 Perfect Rectangle 31.3% Hard
0392 Is Subsequence Go 49.5% Easy
0393 UTF-8 Validation Go 38.1% Medium
0394 Decode String Go 52.8% Medium
0395 Longest Substring with At Least K Repeating Characters Go 43.6% Medium
0396 Rotate Function 36.6% Medium
0397 Integer Replacement Go 33.5% Medium
0398 Random Pick Index 58.1% Medium
0399 Evaluate Division Go 54.5% Medium
0400 Nth Digit 32.4% Medium
0401 Binary Watch Go 48.5% Easy
0402 Remove K Digits Go 28.7% Medium
0403 Frog Jump 41.6% Hard
0404 Sum of Left Leaves Go 52.3% Easy
0405 Convert a Number to Hexadecimal Go 44.5% Easy
0406 Queue Reconstruction by Height 68.5% Medium
0407 Trapping Rain Water II 44.4% Hard
0408 Valid Word Abbreviation 31.4% Easy
0409 Longest Palindrome Go 52.2% Easy
0410 Split Array Largest Sum Go 46.5% Hard
0411 Minimum Unique Word Abbreviation 37.3% Hard
0412 Fizz Buzz Go 63.6% Easy
0413 Arithmetic Slices Go 60.0% Medium
0414 Third Maximum Number Go 30.7% Easy
0415 Add Strings 48.2% Easy
0416 Partition Equal Subset Sum Go 44.9% Medium
0417 Pacific Atlantic Water Flow 42.7% Medium
0418 Sentence Screen Fitting 33.4% Medium
0419 Battleships in a Board 71.1% Medium
0420 Strong Password Checker 14.0% Hard
0421 Maximum XOR of Two Numbers in an Array Go 54.2% Medium
0422 Valid Word Square 38.2% Easy
0423 Reconstruct Original Digits from English 47.5% Medium
0424 Longest Repeating Character Replacement Go 48.3% Medium
0425 Word Squares 50.2% Hard
0426 Convert Binary Search Tree to Sorted Doubly Linked List 61.4% Medium
0427 Construct Quad Tree 62.7% Medium
0428 Serialize and Deserialize N-ary Tree 61.7% Hard
0429 N-ary Tree Level Order Traversal 66.8% Medium
0430 Flatten a Multilevel Doubly Linked List 56.9% Medium
0431 Encode N-ary Tree to Binary Tree 74.8% Hard
0432 All O`one Data Structure 33.2% Hard
0433 Minimum Genetic Mutation Go 43.4% Medium
0434 Number of Segments in a String 37.7% Easy
0435 Non-overlapping Intervals Go 43.8% Medium
0436 Find Right Interval Go 48.5% Medium
0437 Path Sum III Go 48.2% Medium
0438 Find All Anagrams in a String Go 45.1% Medium
0439 Ternary Expression Parser 56.8% Medium
0440 K-th Smallest in Lexicographical Order 29.8% Hard
0441 Arranging Coins Go 42.4% Easy
0442 Find All Duplicates in an Array 69.0% Medium
0443 String Compression 43.9% Medium
0444 Sequence Reconstruction 23.6% Medium
0445 Add Two Numbers II Go 56.4% Medium
0446 Arithmetic Slices II - Subsequence 33.5% Hard
0447 Number of Boomerangs Go 52.5% Medium
0448 Find All Numbers Disappeared in an Array Go 56.1% Easy
0449 Serialize and Deserialize BST 54.2% Medium
0450 Delete Node in a BST 45.4% Medium
0451 Sort Characters By Frequency Go 64.5% Medium
0452 Minimum Number of Arrows to Burst Balloons 49.8% Medium
0453 Minimum Moves to Equal Array Elements Go 50.9% Easy
0454 4Sum II Go 54.6% Medium
0455 Assign Cookies Go 50.4% Easy
0456 132 Pattern Go 30.7% Medium
0457 Circular Array Loop Go 30.3% Medium
0458 Poor Pigs 54.5% Hard
0459 Repeated Substring Pattern 43.3% Easy
0460 LFU Cache Go 36.2% Hard
0461 Hamming Distance Go 73.2% Easy
0462 Minimum Moves to Equal Array Elements II 54.4% Medium
0463 Island Perimeter Go 66.7% Easy
0464 Can I Win 29.7% Medium
0465 Optimal Account Balancing 48.3% Hard
0466 Count The Repetitions 28.6% Hard
0467 Unique Substrings in Wraparound String 36.1% Medium
0468 Validate IP Address 25.0% Medium
0469 Convex Polygon 37.5% Medium
0470 Implement Rand10() Using Rand7() Go 46.0% Medium
0471 Encode String with Shortest Length 49.4% Hard
0472 Concatenated Words 43.8% Hard
0473 Matchsticks to Square 38.3% Medium
0474 Ones and Zeroes Go 43.8% Medium
0475 Heaters Go 33.7% Medium
0476 Number Complement Go 65.1% Easy
0477 Total Hamming Distance Go 50.6% Medium
0478 Generate Random Point in a Circle Go 39.2% Medium
0479 Largest Palindrome Product 29.6% Hard
0480 Sliding Window Median Go 38.8% Hard
0481 Magical String 48.1% Medium
0482 License Key Formatting 43.1% Easy
0483 Smallest Good Base Go 36.3% Hard
0484 Find Permutation 64.3% Medium
0485 Max Consecutive Ones Go 52.8% Easy
0486 Predict the Winner 48.9% Medium
0487 Max Consecutive Ones II 48.0% Medium
0488 Zuma Game 38.2% Hard
0489 Robot Room Cleaner 72.7% Hard
0490 The Maze 52.8% Medium
0491 Increasing Subsequences Go 47.6% Medium
0492 Construct the Rectangle 50.5% Easy
0493 Reverse Pairs Go 27.0% Hard
0494 Target Sum Go 45.7% Medium
0495 Teemo Attacking 56.1% Medium
0496 Next Greater Element I Go 65.8% Easy
0497 Random Point in Non-overlapping Rectangles Go 39.1% Medium
0498 Diagonal Traverse Go 50.4% Medium
0499 The Maze III 42.5% Hard
0500 Keyboard Row Go 65.8% Easy
0501 Find Mode in Binary Search Tree 43.6% Easy
0502 IPO 41.7% Hard
0503 Next Greater Element II Go 58.6% Medium
0504 Base 7 46.4% Easy
0505 The Maze II 48.6% Medium
0506 Relative Ranks 51.4% Easy
0507 Perfect Number Go 36.3% Easy
0508 Most Frequent Subtree Sum Go 59.2% Medium
0509 Fibonacci Number Go 67.5% Easy
0510 Inorder Successor in BST II 60.2% Medium
0511 Game Play Analysis I 81.5% Easy
0512 Game Play Analysis II 56.0% Easy
0513 Find Bottom Left Tree Value Go 62.7% Medium
0514 Freedom Trail 44.9% Hard
0515 Find Largest Value in Each Tree Row Go 62.3% Medium
0516 Longest Palindromic Subsequence 55.6% Medium
0517 Super Washing Machines 38.6% Hard
0518 Coin Change 2 51.9% Medium
0519 Random Flip Matrix 37.8% Medium
0520 Detect Capital 54.0% Easy
0521 Longest Uncommon Subsequence I 58.9% Easy
0522 Longest Uncommon Subsequence II 34.2% Medium
0523 Continuous Subarray Sum 24.7% Medium
0524 Longest Word in Dictionary through Deleting Go 50.1% Medium
0525 Contiguous Array 43.5% Medium
0526 Beautiful Arrangement Go 62.0% Medium
0527 Word Abbreviation 56.3% Hard
0528 Random Pick with Weight Go 44.7% Medium
0529 Minesweeper Go 61.3% Medium
0530 Minimum Absolute Difference in BST 55.0% Easy
0531 Lonely Pixel I 59.6% Medium
0532 K-diff Pairs in an Array Go 35.4% Medium
0533 Lonely Pixel II 48.2% Medium
0534 Game Play Analysis III 79.6% Medium
0535 Encode and Decode TinyURL Go 82.3% Medium
0536 Construct Binary Tree from String 51.9% Medium
0537 Complex Number Multiplication Go 68.3% Medium
0538 Convert BST to Greater Tree Go 59.6% Medium
0539 Minimum Time Difference 52.4% Medium
0540 Single Element in a Sorted Array 57.9% Medium
0541 Reverse String II Go 49.3% Easy
0542 01 Matrix Go 41.0% Medium
0543 Diameter of Binary Tree 49.3% Easy
0544 Output Contest Matches 75.9% Medium
0545 Boundary of Binary Tree 40.1% Medium
0546 Remove Boxes 44.1% Hard
0547 Number of Provinces Go 60.6% Medium
0548 Split Array with Equal Sum 48.1% Medium
0549 Binary Tree Longest Consecutive Sequence II 47.2% Medium
0550 Game Play Analysis IV 45.6% Medium
0551 Student Attendance Record I 46.0% Easy
0552 Student Attendance Record II 37.6% Hard
0553 Optimal Division 57.5% Medium
0554 Brick Wall 50.7% Medium
0555 Split Concatenated Strings 42.8% Medium
0556 Next Greater Element III 33.5% Medium
0557 Reverse Words in a String III Go 72.2% Easy
0558 Logical OR of Two Binary Grids Represented as Quad-Trees 45.6% Medium
0559 Maximum Depth of N-ary Tree 69.6% Easy
0560 Subarray Sum Equals K 43.7% Medium
0561 Array Partition I Go 73.4% Easy
0562 Longest Line of Consecutive One in Matrix 46.2% Medium
0563 Binary Tree Tilt Go 53.1% Easy
0564 Find the Closest Palindrome 20.3% Hard
0565 Array Nesting 56.0% Medium
0566 Reshape the Matrix Go 61.1% Easy
0567 Permutation in String Go 44.6% Medium
0568 Maximum Vacation Days 41.6% Hard
0569 Median Employee Salary 62.0% Hard
0570 Managers with at Least 5 Direct Reports 66.9% Medium
0571 Find Median Given Frequency of Numbers 45.5% Hard
0572 Subtree of Another Tree Go 44.5% Easy
0573 Squirrel Simulation 54.1% Medium
0574 Winning Candidate 52.4% Medium
0575 Distribute Candies Go 64.5% Easy
0576 Out of Boundary Paths 36.0% Medium
0577 Employee Bonus 71.7% Easy
0578 Get Highest Answer Rate Question 41.9% Medium
0579 Find Cumulative Salary of an Employee 38.5% Hard
0580 Count Student Number in Departments 52.0% Medium
0581 Shortest Unsorted Continuous Subarray Go 32.9% Medium
0582 Kill Process 63.8% Medium
0583 Delete Operation for Two Strings 50.2% Medium
0584 Find Customer Referee 74.1% Easy
0585 Investments in 2016 57.2% Medium
0586 Customer Placing the Largest Number of Orders 75.4% Easy
0587 Erect the Fence 36.5% Hard
0588 Design In-Memory File System 46.7% Hard
0589 N-ary Tree Preorder Traversal 73.5% Easy
0590 N-ary Tree Postorder Traversal 73.5% Easy
0591 Tag Validator 34.8% Hard
0592 Fraction Addition and Subtraction 50.2% Medium
0593 Valid Square 43.3% Medium
0594 Longest Harmonious Subsequence Go 51.2% Easy
0595 Big Countries 78.6% Easy
0596 Classes More Than 5 Students 38.9% Easy
0597 Friend Requests I: Overall Acceptance Rate 41.9% Easy
0598 Range Addition II Go 50.2% Easy
0599 Minimum Index Sum of Two Lists Go 51.8% Easy
0600 Non-negative Integers without Consecutive Ones 34.7% Hard
0601 Human Traffic of Stadium 45.5% Hard
0602 Friend Requests II: Who Has the Most Friends 57.6% Medium
0603 Consecutive Available Seats 66.2% Easy
0604 Design Compressed String Iterator 38.2% Easy
0605 Can Place Flowers Go 31.8% Easy
0606 Construct String from Binary Tree 55.4% Easy
0607 Sales Person 65.2% Easy
0608 Tree Node 69.8% Medium
0609 Find Duplicate File in System 61.1% Medium
0610 Triangle Judgement 68.7% Easy
0611 Valid Triangle Number 49.4% Medium
0612 Shortest Distance in a Plane 61.5% Medium
0613 Shortest Distance in a Line 79.8% Easy
0614 Second Degree Follower 32.7% Medium
0615 Average Salary: Departments VS Company 52.8% Hard
0616 Add Bold Tag in String 44.8% Medium
0617 Merge Two Binary Trees 75.5% Easy
0618 Students Report By Geography 60.3% Hard
0619 Biggest Single Number 45.0% Easy
0620 Not Boring Movies 70.0% Easy
0621 Task Scheduler 52.1% Medium
0622 Design Circular Queue 45.9% Medium
0623 Add One Row to Tree Go 53.0% Medium
0624 Maximum Distance in Arrays 39.6% Medium
0625 Minimum Factorization 32.9% Medium
0626 Exchange Seats 65.9% Medium
0627 Swap Salary 77.9% Easy
0628 Maximum Product of Three Numbers Go 46.8% Easy
0629 K Inverse Pairs Array 31.7% Hard
0630 Course Schedule III 33.8% Hard
0631 Design Excel Sum Formula 32.1% Hard
0632 Smallest Range Covering Elements from K Lists Go 54.4% Hard
0633 Sum of Square Numbers Go 32.6% Medium
0634 Find the Derangement of An Array 40.6% Medium
0635 Design Log Storage System 60.0% Medium
0636 Exclusive Time of Functions Go 54.7% Medium
0637 Average of Levels in Binary Tree Go 66.0% Easy
0638 Shopping Offers Go 53.0% Medium
0639 Decode Ways II 27.6% Hard
0640 Solve the Equation 42.8% Medium
0641 Design Circular Deque 56.3% Medium
0642 Design Search Autocomplete System 46.3% Hard
0643 Maximum Average Subarray I Go 42.0% Easy
0644 Maximum Average Subarray II 34.1% Hard
0645 Set Mismatch Go 41.6% Easy
0646 Maximum Length of Pair Chain 53.0% Medium
0647 Palindromic Substrings 62.0% Medium
0648 Replace Words Go 58.8% Medium
0649 Dota2 Senate 39.4% Medium
0650 2 Keys Keyboard 50.2% Medium
0651 4 Keys Keyboard 53.2% Medium
0652 Find Duplicate Subtrees 52.7% Medium
0653 Two Sum IV - Input is a BST Go 56.3% Easy
0654 Maximum Binary Tree 81.3% Medium
0655 Print Binary Tree 56.2% Medium
0656 Coin Path 29.7% Hard
0657 Robot Return to Origin 73.9% Easy
0658 Find K Closest Elements Go 42.1% Medium
0659 Split Array into Consecutive Subsequences 44.4% Medium
0660 Remove 9 54.3% Hard
0661 Image Smoother Go 52.3% Easy
0662 Maximum Width of Binary Tree Go 39.8% Medium
0663 Equal Tree Partition 39.8% Medium
0664 Strange Printer 41.5% Hard
0665 Non-decreasing Array Go 19.8% Medium
0666 Path Sum IV 56.6% Medium
0667 Beautiful Arrangement II 55.2% Medium
0668 Kth Smallest Number in Multiplication Table Go 47.8% Hard
0669 Trim a Binary Search Tree Go 64.4% Medium
0670 Maximum Swap 45.2% Medium
0671 Second Minimum Node In a Binary Tree 42.8% Easy
0672 Bulb Switcher II 51.1% Medium
0673 Number of Longest Increasing Subsequence 38.6% Medium
0674 Longest Continuous Increasing Subsequence Go 46.0% Easy
0675 Cut Off Trees for Golf Event 35.4% Hard
0676 Implement Magic Dictionary Go 55.3% Medium
0677 Map Sum Pairs 54.0% Medium
0678 Valid Parenthesis String 31.7% Medium
0679 24 Game 47.2% Hard
0680 Valid Palindrome II 37.1% Easy
0681 Next Closest Time 46.0% Medium
0682 Baseball Game Go 67.2% Easy
0683 K Empty Slots 36.1% Hard
0684 Redundant Connection Go 59.0% Medium
0685 Redundant Connection II Go 33.0% Hard
0686 Repeated String Match 32.9% Medium
0687 Longest Univalue Path 37.4% Medium
0688 Knight Probability in Chessboard 50.2% Medium
0689 Maximum Sum of 3 Non-Overlapping Subarrays 47.2% Hard
0690 Employee Importance 58.9% Easy
0691 Stickers to Spell Word 44.9% Hard
0692 Top K Frequent Words 53.2% Medium
0693 Binary Number with Alternating Bits Go 59.9% Easy
0694 Number of Distinct Islands 58.0% Medium
0695 Max Area of Island Go 64.9% Medium
0696 Count Binary Substrings 58.0% Easy
0697 Degree of an Array Go 54.5% Easy
0698 Partition to K Equal Sum Subsets 45.7% Medium
0699 Falling Squares Go 42.6% Hard
0700 Search in a Binary Search Tree 73.4% Easy
0701 Insert into a Binary Search Tree 75.4% Medium
0702 Search in a Sorted Array of Unknown Size 68.9% Medium
0703 Kth Largest Element in a Stream Go 50.8% Easy
0704 Binary Search Go 54.1% Easy
0705 Design HashSet Go 64.6% Easy
0706 Design HashMap Go 64.2% Easy
0707 Design Linked List Go 26.0% Medium
0708 Insert into a Sorted Circular Linked List 32.6% Medium
0709 To Lower Case 80.2% Easy
0710 Random Pick with Blacklist Go 32.9% Hard
0711 Number of Distinct Islands II 49.4% Hard
0712 Minimum ASCII Delete Sum for Two Strings 59.5% Medium
0713 Subarray Product Less Than K Go 40.5% Medium
0714 Best Time to Buy and Sell Stock with Transaction Fee Go 58.0% Medium
0715 Range Module Go 40.4% Hard
0716 Max Stack 43.1% Easy
0717 1-bit and 2-bit Characters Go 47.0% Easy
0718 Maximum Length of Repeated Subarray Go 50.4% Medium
0719 Find K-th Smallest Pair Distance Go 32.6% Hard
0720 Longest Word in Dictionary Go 49.3% Easy
0721 Accounts Merge Go 52.1% Medium
0722 Remove Comments 36.3% Medium
0723 Candy Crush 72.9% Medium
0724 Find Pivot Index Go 45.8% Easy
0725 Split Linked List in Parts Go 53.1% Medium
0726 Number of Atoms Go 51.0% Hard
0727 Minimum Window Subsequence 42.3% Hard
0728 Self Dividing Numbers 75.5% Easy
0729 My Calendar I Go 53.5% Medium
0730 Count Different Palindromic Subsequences 43.4% Hard
0731 My Calendar II 50.8% Medium
0732 My Calendar III Go 62.1% Hard
0733 Flood Fill Go 55.9% Easy
0734 Sentence Similarity 42.4% Easy
0735 Asteroid Collision Go 43.3% Medium
0736 Parse Lisp Expression 49.7% Hard
0737 Sentence Similarity II 46.6% Medium
0738 Monotone Increasing Digits 45.8% Medium
0739 Daily Temperatures Go 64.7% Medium
0740 Delete and Earn 49.6% Medium
0741 Cherry Pickup 35.2% Hard
0742 Closest Leaf in a Binary Tree 44.5% Medium
0743 Network Delay Time 45.6% Medium
0744 Find Smallest Letter Greater Than Target Go 45.5% Easy
0745 Prefix and Suffix Search Go 35.4% Hard
0746 Min Cost Climbing Stairs Go 50.9% Easy
0747 Largest Number At Least Twice of Others 43.1% Easy
0748 Shortest Completing Word Go 57.6% Easy
0749 Contain Virus 48.2% Hard
0750 Number Of Corner Rectangles 67.2% Medium
0751 IP to CIDR 59.4% Medium
0752 Open the Lock 52.9% Medium
0753 Cracking the Safe Go 52.4% Hard
0754 Reach a Number 40.5% Medium
0755 Pour Water 44.2% Medium
0756 Pyramid Transition Matrix Go 55.6% Medium
0757 Set Intersection Size At Least Two 42.6% Hard
0758 Bold Words in String 47.4% Easy
0759 Employee Free Time 68.3% Hard
0760 Find Anagram Mappings 81.9% Easy
0761 Special Binary String 58.7% Hard
0762 Prime Number of Set Bits in Binary Representation Go 64.4% Easy
0763 Partition Labels Go 78.1% Medium
0764 Largest Plus Sign 46.6% Medium
0765 Couples Holding Hands Go 55.5% Hard
0766 Toeplitz Matrix Go 65.9% Easy
0767 Reorganize String Go 50.2% Medium
0768 Max Chunks To Make Sorted II 49.8% Hard
0769 Max Chunks To Make Sorted 55.8% Medium
0770 Basic Calculator IV 54.3% Hard
0771 Jewels and Stones Go 87.0% Easy
0772 Basic Calculator III 43.8% Hard
0773 Sliding Puzzle 61.0% Hard
0774 Minimize Max Distance to Gas Station 48.3% Hard
0775 Global and Local Inversions 42.6% Medium
0776 Split BST 56.6% Medium
0777 Swap Adjacent in LR String 35.7% Medium
0778 Swim in Rising Water Go 54.7% Hard
0779 K-th Symbol in Grammar 38.6% Medium
0780 Reaching Points 30.4% Hard
0781 Rabbits in Forest Go 55.6% Medium
0782 Transform to Chessboard 47.0% Hard
0783 Minimum Distance Between BST Nodes 54.0% Easy
0784 Letter Case Permutation Go 68.6% Medium
0785 Is Graph Bipartite? Go 48.7% Medium
0786 K-th Smallest Prime Fraction Go 43.0% Hard
0787 Cheapest Flights Within K Stops 39.6% Medium
0788 Rotated Digits 57.3% Easy
0789 Escape The Ghosts 58.5% Medium
0790 Domino and Tromino Tiling 40.2% Medium
0791 Custom Sort String 65.9% Medium
0792 Number of Matching Subsequences 48.2% Medium
0793 Preimage Size of Factorial Zeroes Function Go 40.6% Hard
0794 Valid Tic-Tac-Toe State 33.7% Medium
0795 Number of Subarrays with Bounded Maximum 47.8% Medium
0796 Rotate String 49.1% Easy
0797 All Paths From Source to Target 78.5% Medium
0798 Smallest Rotation with Highest Score 45.0% Hard
0799 Champagne Tower 44.1% Medium
0800 Similar RGB Color 62.4% Easy
0801 Minimum Swaps To Make Sequences Increasing 39.0% Medium
0802 Find Eventual Safe States Go 49.9% Medium
0803 Bricks Falling When Hit Go 31.5% Hard
0804 Unique Morse Code Words 79.0% Easy
0805 Split Array With Same Average 26.9% Hard
0806 Number of Lines To Write String 65.5% Easy
0807 Max Increase to Keep City Skyline 84.4% Medium
0808 Soup Servings 41.0% Medium
0809 Expressive Words 46.4% Medium
0810 Chalkboard XOR Game 50.2% Hard
0811 Subdomain Visit Count Go 71.6% Easy
0812 Largest Triangle Area Go 59.0% Easy
0813 Largest Sum of Averages 51.2% Medium
0814 Binary Tree Pruning 72.2% Medium
0815 Bus Routes Go 43.4% Hard
0816 Ambiguous Coordinates 48.1% Medium
0817 Linked List Components Go 57.8% Medium
0818 Race Car 40.1% Hard
0819 Most Common Word Go 45.5% Easy
0820 Short Encoding of Words Go 55.1% Medium
0821 Shortest Distance to a Character Go 70.0% Easy
0822 Card Flipping Game 43.7% Medium
0823 Binary Trees With Factors Go 43.8% Medium
0824 Goat Latin 66.7% Easy
0825 Friends Of Appropriate Ages 44.2% Medium
0826 Most Profit Assigning Work Go 39.2% Medium
0827 Making A Large Island 47.3% Hard
0828 Count Unique Characters of All Substrings of a Given String Go 46.8% Hard
0829 Consecutive Numbers Sum 39.3% Hard
0830 Positions of Large Groups Go 50.4% Easy
0831 Masking Personal Information 44.7% Medium
0832 Flipping an Image Go 78.2% Easy
0833 Find And Replace in String 51.5% Medium
0834 Sum of Distances in Tree Go 46.3% Hard
0835 Image Overlap 61.7% Medium
0836 Rectangle Overlap Go 44.0% Easy
0837 New 21 Game 35.4% Medium
0838 Push Dominoes Go 49.9% Medium
0839 Similar String Groups Go 41.2% Hard
0840 Magic Squares In Grid 37.9% Medium
0841 Keys and Rooms Go 66.4% Medium
0842 Split Array into Fibonacci Sequence Go 37.0% Medium
0843 Guess the Word 46.4% Hard
0844 Backspace String Compare Go 47.1% Easy
0845 Longest Mountain in Array Go 38.6% Medium
0846 Hand of Straights 55.5% Medium
0847 Shortest Path Visiting All Nodes 53.9% Hard
0848 Shifting Letters 45.2% Medium
0849 Maximize Distance to Closest Person 44.5% Medium
0850 Rectangle Area II Go 48.4% Hard
0851 Loud and Rich Go 52.7% Medium
0852 Peak Index in a Mountain Array Go 71.6% Easy
0853 Car Fleet Go 44.2% Medium
0854 K-Similar Strings 38.7% Hard
0855 Exam Room 43.4% Medium
0856 Score of Parentheses Go 64.9% Medium
0857 Minimum Cost to Hire K Workers 50.5% Hard
0858 Mirror Reflection 59.6% Medium
0859 Buddy Strings 29.2% Easy
0860 Lemonade Change 51.8% Easy
0861 Score After Flipping Matrix 73.8% Medium
0862 Shortest Subarray with Sum at Least K Go 25.2% Hard
0863 All Nodes Distance K in Binary Tree Go 58.1% Medium
0864 Shortest Path to Get All Keys Go 42.3% Hard
0865 Smallest Subtree with all the Deepest Nodes 64.9% Medium
0866 Prime Palindrome 25.0% Medium
0867 Transpose Matrix Go 62.0% Easy
0868 Binary Gap 60.9% Easy
0869 Reordered Power of 2 Go 58.5% Medium
0870 Advantage Shuffle 47.0% Medium
0871 Minimum Number of Refueling Stops 32.4% Hard
0872 Leaf-Similar Trees Go 64.5% Easy
0873 Length of Longest Fibonacci Subsequence 48.2% Medium
0874 Walking Robot Simulation 36.8% Easy
0875 Koko Eating Bananas Go 53.5% Medium
0876 Middle of the Linked List Go 69.2% Easy
0877 Stone Game 67.0% Medium
0878 Nth Magical Number Go 28.8% Hard
0879 Profitable Schemes 39.9% Hard
0880 Decoded String at Index Go 28.2% Medium
0881 Boats to Save People Go 49.0% Medium
0882 Reachable Nodes In Subdivided Graph 43.0% Hard
0883 Projection Area of 3D Shapes 68.4% Easy
0884 Uncommon Words from Two Sentences Go 64.2% Easy
0885 Spiral Matrix III Go 71.0% Medium
0886 Possible Bipartition 45.2% Medium
0887 Super Egg Drop Go 27.0% Hard
0888 Fair Candy Swap Go 59.1% Easy
0889 Construct Binary Tree from Preorder and Postorder Traversal 67.7% Medium
0890 Find and Replace Pattern 74.2% Medium
0891 Sum of Subsequence Widths Go 33.1% Hard
0892 Surface Area of 3D Shapes Go 59.9% Easy
0893 Groups of Special-Equivalent Strings 69.3% Easy
0894 All Possible Full Binary Trees 77.1% Medium
0895 Maximum Frequency Stack Go 63.1% Hard
0896 Monotonic Array Go 58.0% Easy
0897 Increasing Order Search Tree Go 74.6% Easy
0898 Bitwise ORs of Subarrays Go 34.3% Medium
0899 Orderly Queue 53.3% Hard
0900 RLE Iterator 55.5% Medium
0901 Online Stock Span Go 61.4% Medium
0902 Numbers At Most N Given Digit Set 36.1% Hard
0903 Valid Permutations for DI Sequence 54.2% Hard
0904 Fruit Into Baskets Go 43.0% Medium
0905 Sort Array By Parity 75.0% Easy
0906 Super Palindromes 32.7% Hard
0907 Sum of Subarray Minimums Go 33.1% Medium
0908 Smallest Range I 66.3% Easy
0909 Snakes and Ladders 39.4% Medium
0910 Smallest Range II Go 31.2% Medium
0911 Online Election Go 51.4% Medium
0912 Sort an Array 64.6% Medium
0913 Cat and Mouse 34.7% Hard
0914 X of a Kind in a Deck of Cards Go 34.1% Easy
0915 Partition Array into Disjoint Intervals 46.2% Medium
0916 Word Subsets 48.1% Medium
0917 Reverse Only Letters 59.2% Easy
0918 Maximum Sum Circular Subarray Go 34.3% Medium
0919 Complete Binary Tree Inserter 59.0% Medium
0920 Number of Music Playlists Go 47.8% Hard
0921 Minimum Add to Make Parentheses Valid Go 74.9% Medium
0922 Sort Array By Parity II Go 70.6% Easy
0923 3Sum With Multiplicity Go 36.3% Medium
0924 Minimize Malware Spread Go 41.9% Hard
0925 Long Pressed Name Go 37.7% Easy
0926 Flip String to Monotone Increasing 53.4% Medium
0927 Three Equal Parts Go 34.7% Hard
0928 Minimize Malware Spread II Go 41.5% Hard
0929 Unique Email Addresses 67.2% Easy
0930 Binary Subarrays With Sum Go 44.7% Medium
0931 Minimum Falling Path Sum 63.6% Medium
0932 Beautiful Array 61.4% Medium
0933 Number of Recent Calls Go 72.4% Easy
0934 Shortest Bridge 49.8% Medium
0935 Knight Dialer 46.6% Medium
0936 Stamping The Sequence 47.6% Hard
0937 Reorder Data in Log Files 54.6% Easy
0938 Range Sum of BST 83.1% Easy
0939 Minimum Area Rectangle 52.0% Medium
0940 Distinct Subsequences II 41.6% Hard
0941 Valid Mountain Array 33.1% Easy
0942 DI String Match Go 73.6% Easy
0943 Find the Shortest Superstring 43.4% Hard
0944 Delete Columns to Make Sorted 70.9% Easy
0945 Minimum Increment to Make Array Unique 46.8% Medium
0946 Validate Stack Sequences Go 64.4% Medium
0947 Most Stones Removed with Same Row or Column Go 55.5% Medium
0948 Bag of Tokens 46.1% Medium
0949 Largest Time for Given Digits Go 36.2% Medium
0950 Reveal Cards In Increasing Order 75.4% Medium
0951 Flip Equivalent Binary Trees 65.7% Medium
0952 Largest Component Size by Common Factor Go 36.2% Hard
0953 Verifying an Alien Dictionary Go 51.9% Easy
0954 Array of Doubled Pairs 35.1% Medium
0955 Delete Columns to Make Sorted II 33.9% Medium
0956 Tallest Billboard 39.9% Hard
0957 Prison Cells After N Days 40.1% Medium
0958 Check Completeness of a Binary Tree 52.5% Medium
0959 Regions Cut By Slashes Go 67.2% Medium
0960 Delete Columns to Make Sorted III 55.0% Hard
0961 N-Repeated Element in Size 2N Array Go 74.6% Easy
0962 Maximum Width Ramp 46.6% Medium
0963 Minimum Area Rectangle II 52.1% Medium
0964 Least Operators to Express Number 45.1% Hard
0965 Univalued Binary Tree 67.9% Easy
0966 Vowel Spellchecker 47.9% Medium
0967 Numbers With Same Consecutive Differences 45.0% Medium
0968 Binary Tree Cameras Go 38.8% Hard
0969 Pancake Sorting Go 68.7% Medium
0970 Powerful Integers Go 40.0% Medium
0971 Flip Binary Tree To Match Preorder Traversal 46.1% Medium
0972 Equal Rational Numbers 42.1% Hard
0973 K Closest Points to Origin Go 64.6% Medium
0974 Subarray Sums Divisible by K 50.9% Medium
0975 Odd Even Jump 41.5% Hard
0976 Largest Perimeter Triangle Go 58.7% Easy
0977 Squares of a Sorted Array Go 71.9% Easy
0978 Longest Turbulent Subarray Go 46.6% Medium
0979 Distribute Coins in Binary Tree Go 69.8% Medium
0980 Unique Paths III Go 77.1% Hard
0981 Time Based Key-Value Store Go 54.2% Medium
0982 Triples with Bitwise AND Equal To Zero 56.3% Hard
0983 Minimum Cost For Tickets 62.8% Medium
0984 String Without AAA or BBB Go 38.7% Medium
0985 Sum of Even Numbers After Queries Go 60.7% Easy
0986 Interval List Intersections Go 68.4% Medium
0987 Vertical Order Traversal of a Binary Tree Go 38.9% Hard
0988 Smallest String Starting From Leaf 46.8% Medium
0989 Add to Array-Form of Integer Go 44.9% Easy
0990 Satisfiability of Equality Equations Go 46.9% Medium
0991 Broken Calculator Go 49.8% Medium
0992 Subarrays with K Different Integers Go 50.8% Hard
0993 Cousins in Binary Tree Go 52.3% Easy
0994 Rotting Oranges 49.6% Medium
0995 Minimum Number of K Consecutive Bit Flips Go 50.0% Hard
0996 Number of Squareful Arrays Go 48.5% Hard
0997 Find the Town Judge 49.8% Easy
0998 Maximum Binary Tree II 64.0% Medium
0999 Available Captures for Rook Go 67.8% Easy
1000 Minimum Cost to Merge Stones 40.5% Hard
1001 Grid Illumination 36.3% Hard
1002 Find Common Characters Go 68.7% Easy
1003 Check If Word Is Valid After Substitutions Go 56.5% Medium
1004 Max Consecutive Ones III Go 60.9% Medium
1005 Maximize Sum Of Array After K Negations Go 52.3% Easy
1006 Clumsy Factorial 53.6% Medium
1007 Minimum Domino Rotations For Equal Row 50.9% Medium
1008 Construct Binary Search Tree from Preorder Traversal 78.8% Medium
1009 Complement of Base 10 Integer 61.4% Easy
1010 Pairs of Songs With Total Durations Divisible by 60 50.5% Medium
1011 Capacity To Ship Packages Within D Days Go 59.8% Medium
1012 Numbers With Repeated Digits 37.8% Hard
1013 Partition Array Into Three Parts With Equal Sum 48.5% Easy
1014 Best Sightseeing Pair 52.9% Medium
1015 Smallest Integer Divisible by K 41.9% Medium
1016 Binary String With Substrings Representing 1 To N 58.8% Medium
1017 Convert to Base -2 Go 59.8% Medium
1018 Binary Prefix Divisible By 5 Go 47.8% Easy
1019 Next Greater Node In Linked List Go 58.3% Medium
1020 Number of Enclaves Go 59.1% Medium
1021 Remove Outermost Parentheses Go 79.1% Easy
1022 Sum of Root To Leaf Binary Numbers 71.6% Easy
1023 Camelcase Matching 57.6% Medium
1024 Video Stitching 49.0% Medium
1025 Divisor Game Go 66.1% Easy
1026 Maximum Difference Between Node and Ancestor Go 69.6% Medium
1027 Longest Arithmetic Subsequence 49.7% Medium
1028 Recover a Tree From Preorder Traversal Go 71.0% Hard
1029 Two City Scheduling 58.1% Medium
1030 Matrix Cells in Distance Order Go 67.2% Easy
1031 Maximum Sum of Two Non-Overlapping Subarrays 59.0% Medium
1032 Stream of Characters 48.6% Hard
1033 Moving Stones Until Consecutive 43.3% Easy
1034 Coloring A Border 45.7% Medium
1035 Uncrossed Lines 56.2% Medium
1036 Escape a Large Maze 34.4% Hard
1037 Valid Boomerang Go 37.8% Easy
1038 Binary Search Tree to Greater Sum Tree Go 82.4% Medium
1039 Minimum Score Triangulation of Polygon 50.2% Medium
1040 Moving Stones Until Consecutive II Go 54.1% Medium
1041 Robot Bounded In Circle 55.1% Medium
1042 Flower Planting With No Adjacent 48.8% Medium
1043 Partition Array for Maximum Sum 67.2% Medium
1044 Longest Duplicate Substring 31.4% Hard
1045 Customers Who Bought All Products 68.4% Medium
1046 Last Stone Weight 62.4% Easy
1047 Remove All Adjacent Duplicates In String Go 71.0% Easy
1048 Longest String Chain 55.5% Medium
1049 Last Stone Weight II Go 45.6% Medium
1050 Actors and Directors Who Cooperated At Least Three Times 72.4% Easy
1051 Height Checker Go 72.1% Easy
1052 Grumpy Bookstore Owner Go 55.8% Medium
1053 Previous Permutation With One Swap 51.1% Medium
1054 Distant Barcodes Go 44.2% Medium
1055 Shortest Way to Form String 57.2% Medium
1056 Confusing Number 47.0% Easy
1057 Campus Bikes 57.8% Medium
1058 Minimize Rounding Error to Meet Target 43.7% Medium
1059 All Paths from Source Lead to Destination 42.9% Medium
1060 Missing Element in Sorted Array 54.8% Medium
1061 Lexicographically Smallest Equivalent String 66.8% Medium
1062 Longest Repeating Substring 58.3% Medium
1063 Number of Valid Subarrays 72.2% Hard
1064 Fixed Point 64.9% Easy
1065 Index Pairs of a String 61.0% Easy
1066 Campus Bikes II 54.2% Medium
1067 Digit Count in Range 41.6% Hard
1068 Product Sales Analysis I 82.1% Easy
1069 Product Sales Analysis II 83.2% Easy
1070 Product Sales Analysis III 49.9% Medium
1071 Greatest Common Divisor of Strings 51.3% Easy
1072 Flip Columns For Maximum Number of Equal Rows 61.5% Medium
1073 Adding Two Negabinary Numbers Go 34.8% Medium
1074 Number of Submatrices That Sum to Target Go 61.9% Hard
1075 Project Employees I 66.2% Easy
1076 Project Employees II 52.9% Easy
1077 Project Employees III 77.8% Medium
1078 Occurrences After Bigram Go 64.9% Easy
1079 Letter Tile Possibilities Go 75.9% Medium
1080 Insufficient Nodes in Root to Leaf Paths 50.0% Medium
1081 Smallest Subsequence of Distinct Characters 53.5% Medium
1082 Sales Analysis I 73.9% Easy
1083 Sales Analysis II 50.9% Easy
1084 Sales Analysis III 54.7% Easy
1085 Sum of Digits in the Minimum Number 75.1% Easy
1086 High Five 77.6% Easy
1087 Brace Expansion 63.1% Medium
1088 Confusing Number II 45.5% Hard
1089 Duplicate Zeros Go 51.7% Easy
1090 Largest Values From Labels 60.0% Medium
1091 Shortest Path in Binary Matrix Go 40.1% Medium
1092 Shortest Common Supersequence 53.0% Hard
1093 Statistics from a Large Sample Go 49.1% Medium
1094 Car Pooling 59.7% Medium
1095 Find in Mountain Array 36.1% Hard
1096 Brace Expansion II 62.6% Hard
1097 Game Play Analysis V 56.6% Hard
1098 Unpopular Books 45.6% Medium
1099 Two Sum Less Than K 60.8% Easy
1100 Find K-Length Substrings With No Repeated Characters 73.0% Medium
1101 The Earliest Moment When Everyone Become Friends 67.8% Medium
1102 Path With Maximum Minimum Value 50.6% Medium
1103 Distribute Candies to People 63.5% Easy
1104 Path In Zigzag Labelled Binary Tree 73.2% Medium
1105 Filling Bookcase Shelves Go 57.5% Medium
1106 Parsing A Boolean Expression 59.3% Hard
1107 New Users Daily Count 46.1% Medium
1108 Defanging an IP Address Go 88.4% Easy
1109 Corporate Flight Bookings 54.3% Medium
1110 Delete Nodes And Return Forest Go 67.8% Medium
1111 Maximum Nesting Depth of Two Valid Parentheses Strings Go 72.6% Medium
1112 Highest Grade For Each Student 72.2% Medium
1113 Reported Posts 65.9% Easy
1114 Print in Order 67.2% Easy
1115 Print FooBar Alternately 59.0% Medium
1116 Print Zero Even Odd 57.8% Medium
1117 Building H2O 53.1% Medium
1118 Number of Days in a Month 57.3% Easy
1119 Remove Vowels from a String 90.5% Easy
1120 Maximum Average Subtree 63.7% Medium
1121 Divide Array Into Increasing Sequences 58.2% Hard
1122 Relative Sort Array Go 68.1% Easy
1123 Lowest Common Ancestor of Deepest Leaves Go 68.0% Medium
1124 Longest Well-Performing Interval 33.3% Medium
1125 Smallest Sufficient Team 47.0% Hard
1126 Active Businesses 68.6% Medium
1127 User Purchase Platform 50.6% Hard
1128 Number of Equivalent Domino Pairs Go 46.4% Easy
1129 Shortest Path with Alternating Colors 40.3% Medium
1130 Minimum Cost Tree From Leaf Values 67.3% Medium
1131 Maximum of Absolute Value Expression 51.7% Medium
1132 Reported Posts II 34.6% Medium
1133 Largest Unique Number 67.2% Easy
1134 Armstrong Number 78.1% Easy
1135 Connecting Cities With Minimum Cost 59.5% Medium
1136 Parallel Courses 60.7% Medium
1137 N-th Tribonacci Number Go 55.9% Easy
1138 Alphabet Board Path 51.3% Medium
1139 Largest 1-Bordered Square 48.6% Medium
1140 Stone Game II 64.6% Medium
1141 User Activity for the Past 30 Days I 54.4% Easy
1142 User Activity for the Past 30 Days II 35.4% Easy
1143 Longest Common Subsequence 58.7% Medium
1144 Decrease Elements To Make Array Zigzag 46.1% Medium
1145 Binary Tree Coloring Game Go 51.3% Medium
1146 Snapshot Array 36.8% Medium
1147 Longest Chunked Palindrome Decomposition 59.5% Hard
1148 Article Views I 77.1% Easy
1149 Article Views II 48.3% Medium
1150 Check If a Number Is Majority Element in a Sorted Array 57.2% Easy
1151 Minimum Swaps to Group All 1’s Together 58.7% Medium
1152 Analyze User Website Visit Pattern 43.1% Medium
1153 String Transforms Into Another String 35.8% Hard
1154 Day of the Year Go 49.2% Easy
1155 Number of Dice Rolls With Target Sum 47.6% Medium
1156 Swap For Longest Repeated Character Substring 47.1% Medium
1157 Online Majority Element In Subarray Go 39.8% Hard
1158 Market Analysis I 64.1% Medium
1159 Market Analysis II 56.2% Hard
1160 Find Words That Can Be Formed by Characters Go 67.9% Easy
1161 Maximum Level Sum of a Binary Tree 69.2% Medium
1162 As Far from Land as Possible 45.5% Medium
1163 Last Substring in Lexicographical Order 36.3% Hard
1164 Product Price at a Given Date 68.8% Medium
1165 Single-Row Keyboard 85.5% Easy
1166 Design File System 58.5% Medium
1167 Minimum Cost to Connect Sticks 64.6% Medium
1168 Optimize Water Distribution in a Village 61.0% Hard
1169 Invalid Transactions 30.9% Medium
1170 Compare Strings by Frequency of the Smallest Character Go 60.1% Medium
1171 Remove Zero Sum Consecutive Nodes from Linked List Go 41.5% Medium
1172 Dinner Plate Stacks 37.6% Hard
1173 Immediate Food Delivery I 82.6% Easy
1174 Immediate Food Delivery II 62.0% Medium
1175 Prime Arrangements Go 51.7% Easy
1176 Diet Plan Performance 53.7% Easy
1177 Can Make Palindrome from Substring 36.1% Medium
1178 Number of Valid Words for Each Puzzle Go 39.4% Hard
1179 Reformat Department Table 82.0% Easy
1180 Count Substrings with Only One Distinct Letter 77.7% Easy
1181 Before and After Puzzle 44.5% Medium
1182 Shortest Distance to Target Color 53.5% Medium
1183 Maximum Number of Ones 57.6% Hard
1184 Distance Between Bus Stops Go 54.0% Easy
1185 Day of the Week Go 61.2% Easy
1186 Maximum Subarray Sum with One Deletion 38.8% Medium
1187 Make Array Strictly Increasing 42.1% Hard
1188 Design Bounded Blocking Queue 72.8% Medium
1189 Maximum Number of Balloons Go 62.1% Easy
1190 Reverse Substrings Between Each Pair of Parentheses 64.2% Medium
1191 K-Concatenation Maximum Sum 25.1% Medium
1192 Critical Connections in a Network 50.2% Hard
1193 Monthly Transactions I 69.0% Medium
1194 Tournament Winners 52.4% Hard
1195 Fizz Buzz Multithreaded 70.8% Medium
1196 How Many Apples Can You Put into the Basket 68.1% Easy
1197 Minimum Knight Moves 37.3% Medium
1198 Find Smallest Common Element in All Rows 75.3% Medium
1199 Minimum Time to Build Blocks 38.8% Hard
1200 Minimum Absolute Difference Go 67.0% Easy
1201 Ugly Number III Go 26.4% Medium
1202 Smallest String With Swaps Go 48.9% Medium
1203 Sort Items by Groups Respecting Dependencies Go 48.3% Hard
1204 Last Person to Fit in the Elevator 71.9% Medium
1205 Monthly Transactions II 45.7% Medium
1206 Design Skiplist 58.9% Hard
1207 Unique Number of Occurrences Go 71.8% Easy
1208 Get Equal Substrings Within Budget Go 44.1% Medium
1209 Remove All Adjacent Duplicates in String II 57.6% Medium
1210 Minimum Moves to Reach Target with Rotations 46.6% Hard
1211 Queries Quality and Percentage 70.1% Easy
1212 Team Scores in Football Tournament 56.9% Medium
1213 Intersection of Three Sorted Arrays 79.4% Easy
1214 Two Sum BSTs 67.5% Medium
1215 Stepping Numbers 43.6% Medium
1216 Valid Palindrome III 49.9% Hard
1217 Minimum Cost to Move Chips to The Same Position Go 71.1% Easy
1218 Longest Arithmetic Subsequence of Given Difference 46.8% Medium
1219 Path with Maximum Gold 65.8% Medium
1220 Count Vowels Permutation 54.1% Hard
1221 Split a String in Balanced Strings Go 84.3% Easy
1222 Queens That Can Attack the King 69.4% Medium
1223 Dice Roll Simulation 46.7% Hard
1224 Maximum Equal Frequency 35.1% Hard
1225 Report Contiguous Dates 62.9% Hard
1226 The Dining Philosophers 59.7% Medium
1227 Airplane Seat Assignment Probability 62.2% Medium
1228 Missing Number In Arithmetic Progression 51.1% Easy
1229 Meeting Scheduler 54.3% Medium
1230 Toss Strange Coins 50.4% Medium
1231 Divide Chocolate 53.6% Hard
1232 Check If It Is a Straight Line Go 43.4% Easy
1233 Remove Sub-Folders from the Filesystem 62.2% Medium
1234 Replace the Substring for Balanced String Go 34.5% Medium
1235 Maximum Profit in Job Scheduling Go 47.5% Hard
1236 Web Crawler 64.6% Medium
1237 Find Positive Integer Solution for a Given Equation 69.4% Medium
1238 Circular Permutation in Binary Representation 66.3% Medium
1239 Maximum Length of a Concatenated String with Unique Characters 49.7% Medium
1240 Tiling a Rectangle with the Fewest Squares 52.6% Hard
1241 Number of Comments per Post 67.9% Easy
1242 Web Crawler Multithreaded 47.6% Medium
1243 Array Transformation 49.9% Easy
1244 Design A Leaderboard 66.2% Medium
1245 Tree Diameter 61.1% Medium
1246 Palindrome Removal 46.0% Hard
1247 Minimum Swaps to Make Strings Equal 62.9% Medium
1248 Count Number of Nice Subarrays 56.1% Medium
1249 Minimum Remove to Make Valid Parentheses Go 64.2% Medium
1250 Check If It Is a Good Array 56.2% Hard
1251 Average Selling Price 82.7% Easy
1252 Cells with Odd Values in a Matrix Go 78.8% Easy
1253 Reconstruct a 2-Row Binary Matrix 41.7% Medium
1254 Number of Closed Islands Go 61.7% Medium
1255 Maximum Score Words Formed by Letters 70.0% Hard
1256 Encode Number 68.0% Medium
1257 Smallest Common Region 61.1% Medium
1258 Synonymous Sentences 62.9% Medium
1259 Handshakes That Don’t Cross 54.3% Hard
1260 Shift 2D Grid Go 61.8% Easy
1261 Find Elements in a Contaminated Binary Tree 74.5% Medium
1262 Greatest Sum Divisible by Three 49.8% Medium
1263 Minimum Moves to Move a Box to Their Target Location 43.4% Hard
1264 Page Recommendations 69.3% Medium
1265 Print Immutable Linked List in Reverse 94.2% Medium
1266 Minimum Time Visiting All Points Go 79.3% Easy
1267 Count Servers that Communicate 57.8% Medium
1268 Search Suggestions System 64.7% Medium
1269 Number of Ways to Stay in the Same Place After Some Steps 43.2% Hard
1270 All People Report to the Given Manager 88.3% Medium
1271 Hexspeak 55.4% Easy
1272 Remove Interval 58.3% Medium
1273 Delete Tree Nodes 62.1% Medium
1274 Number of Ships in a Rectangle 66.0% Hard
1275 Find Winner on a Tic Tac Toe Game Go 52.9% Easy
1276 Number of Burgers with No Waste of Ingredients 50.1% Medium
1277 Count Square Submatrices with All Ones 72.8% Medium
1278 Palindrome Partitioning III 61.1% Hard
1279 Traffic Light Controlled Intersection 76.0% Easy
1280 Students and Examinations 75.1% Easy
1281 Subtract the Product and Sum of Digits of an Integer Go 85.6% Easy
1282 Group the People Given the Group Size They Belong To 84.4% Medium
1283 Find the Smallest Divisor Given a Threshold Go 49.7% Medium
1284 Minimum Number of Flips to Convert Binary Matrix to Zero Matrix 70.1% Hard
1285 Find the Start and End Number of Continuous Ranges 87.4% Medium
1286 Iterator for Combination 70.9% Medium
1287 Element Appearing More Than 25% In Sorted Array Go 60.1% Easy
1288 Remove Covered Intervals 57.4% Medium
1289 Minimum Falling Path Sum II 62.5% Hard
1290 Convert Binary Number in a Linked List to Integer Go 81.8% Easy
1291 Sequential Digits 57.4% Medium
1292 Maximum Side Length of a Square with Sum Less than or Equal to Threshold 50.8% Medium
1293 Shortest Path in a Grid with Obstacles Elimination 43.1% Hard
1294 Weather Type in Each Country 66.6% Easy
1295 Find Numbers with Even Number of Digits Go 78.9% Easy
1296 Divide Array in Sets of K Consecutive Numbers 55.6% Medium
1297 Maximum Number of Occurrences of a Substring 50.5% Medium
1298 Maximum Candies You Can Get from Boxes 59.8% Hard
1299 Replace Elements with Greatest Element on Right Side Go 74.6% Easy
1300 Sum of Mutated Array Closest to Target Go 43.0% Medium
1301 Number of Paths with Max Score 38.3% Hard
1302 Deepest Leaves Sum Go 84.2% Medium
1303 Find the Team Size 89.7% Easy
1304 Find N Unique Integers Sum up to Zero Go 76.7% Easy
1305 All Elements in Two Binary Search Trees Go 77.8% Medium
1306 Jump Game III Go 62.3% Medium
1307 Verbal Arithmetic Puzzle 36.8% Hard
1308 Running Total for Different Genders 87.8% Medium
1309 Decrypt String from Alphabet to Integer Mapping 77.7% Easy
1310 XOR Queries of a Subarray 69.4% Medium
1311 Get Watched Videos by Your Friends 44.3% Medium
1312 Minimum Insertion Steps to Make a String Palindrome 59.8% Hard
1313 Decompress Run-Length Encoded List Go 85.4% Easy
1314 Matrix Block Sum 73.7% Medium
1315 Sum of Nodes with Even-Valued Grandparent 84.2% Medium
1316 Distinct Echo Substrings 49.8% Hard
1317 Convert Integer to the Sum of Two No-Zero Integers Go 56.8% Easy
1318 Minimum Flips to Make a OR b Equal to c 63.9% Medium
1319 Number of Operations to Make Network Connected Go 55.5% Medium
1320 Minimum Distance to Type a Word Using Two Fingers 61.8% Hard
1321 Restaurant Growth 71.5% Medium
1322 Ads Performance 58.1% Easy
1323 Maximum 69 Number 77.9% Easy
1324 Print Words Vertically 58.9% Medium
1325 Delete Leaves With a Given Value 73.8% Medium
1326 Minimum Number of Taps to Open to Water a Garden 47.6% Hard
1327 List the Products Ordered in a Period 77.7% Easy
1328 Break a Palindrome 47.2% Medium
1329 Sort the Matrix Diagonally Go 81.7% Medium
1330 Reverse Subarray To Maximize Array Value 36.7% Hard
1331 Rank Transform of an Array 57.4% Easy
1332 Remove Palindromic Subsequences Go 68.1% Easy
1333 Filter Restaurants by Vegan-Friendly, Price and Distance 57.2% Medium
1334 Find the City With the Smallest Number of Neighbors at a Threshold Distance 47.2% Medium
1335 Minimum Difficulty of a Job Schedule 56.7% Hard
1336 Number of Transactions per Visit 48.6% Hard
1337 The K Weakest Rows in a Matrix Go 71.9% Easy
1338 Reduce Array Size to The Half 67.7% Medium
1339 Maximum Product of Splitted Binary Tree 38.4% Medium
1340 Jump Game V 59.3% Hard
1341 Movie Rating 58.9% Medium
1342 Number of Steps to Reduce a Number to Zero 85.7% Easy
1343 Number of Sub-arrays of Size K and Average Greater than or Equal to Threshold 64.8% Medium
1344 Angle Between Hands of a Clock 61.3% Medium
1345 Jump Game IV 41.9% Hard
1346 Check If N and Its Double Exist 36.1% Easy
1347 Minimum Number of Steps to Make Two Strings Anagram 75.0% Medium
1348 Tweet Counts Per Frequency 36.6% Medium
1349 Maximum Students Taking Exam 44.2% Hard
1350 Students With Invalid Departments 90.3% Easy
1351 Count Negative Numbers in a Sorted Matrix 75.8% Easy
1352 Product of the Last K Numbers 44.8% Medium
1353 Maximum Number of Events That Can Be Attended 30.5% Medium
1354 Construct Target Array With Multiple Sums 31.3% Hard
1355 Activity Participants 74.4% Medium
1356 Sort Integers by The Number of 1 Bits 69.7% Easy
1357 Apply Discount Every n Orders 66.9% Medium
1358 Number of Substrings Containing All Three Characters 60.6% Medium
1359 Count All Valid Pickup and Delivery Options 56.3% Hard
1360 Number of Days Between Two Dates 46.6% Easy
1361 Validate Binary Tree Nodes 43.6% Medium
1362 Closest Divisors 57.7% Medium
1363 Largest Multiple of Three 34.1% Hard
1364 Number of Trusted Contacts of a Customer 78.9% Medium
1365 How Many Numbers Are Smaller Than the Current Number 85.9% Easy
1366 Rank Teams by Votes 55.4% Medium
1367 Linked List in Binary Tree 41.0% Medium
1368 Minimum Cost to Make at Least One Valid Path in a Grid 57.5% Hard
1369 Get the Second Most Recent Activity 69.0% Hard
1370 Increasing Decreasing String 77.2% Easy
1371 Find the Longest Substring Containing Vowels in Even Counts 60.9% Medium
1372 Longest ZigZag Path in a Binary Tree 55.0% Medium
1373 Maximum Sum BST in Binary Tree 37.3% Hard
1374 Generate a String With Characters That Have Odd Counts 76.8% Easy
1375 Bulb Switcher III 64.2% Medium
1376 Time Needed to Inform All Employees 56.6% Medium
1377 Frog Position After T Seconds 35.2% Hard
1378 Replace Employee ID With The Unique Identifier 90.2% Easy
1379 Find a Corresponding Node of a Binary Tree in a Clone of That Tree 84.7% Medium
1380 Lucky Numbers in a Matrix Go 70.5% Easy
1381 Design a Stack With Increment Operation 76.2% Medium
1382 Balance a Binary Search Tree 76.1% Medium
1383 Maximum Performance of a Team 35.8% Hard
1384 Total Sales Amount by Year 64.6% Hard
1385 Find the Distance Value Between Two Arrays Go 66.3% Easy
1386 Cinema Seat Allocation 35.8% Medium
1387 Sort Integers by The Power Value 70.5% Medium
1388 Pizza With 3n Slices 46.0% Hard
1389 Create Target Array in the Given Order Go 84.9% Easy
1390 Four Divisors 39.3% Medium
1391 Check if There is a Valid Path in a Grid 44.9% Medium
1392 Longest Happy Prefix 42.0% Hard
1393 Capital Gain/Loss 90.9% Medium
1394 Find Lucky Integer in an Array 63.2% Easy
1395 Count Number of Teams 76.1% Medium
1396 Design Underground System Go 71.9% Medium
1397 Find All Good Strings 38.6% Hard
1398 Customers Who Bought Products A and B but Not C 82.0% Medium
1399 Count Largest Group 65.3% Easy
1400 Construct K Palindrome Strings 63.1% Medium
1401 Circle and Rectangle Overlapping 42.4% Medium
1402 Reducing Dishes 72.1% Hard
1403 Minimum Subsequence in Non-Increasing Order 71.1% Easy
1404 Number of Steps to Reduce a Number in Binary Representation to One 49.9% Medium
1405 Longest Happy String 52.5% Medium
1406 Stone Game III 57.6% Hard
1407 Top Travellers 83.9% Easy
1408 String Matching in an Array 63.5% Easy
1409 Queries on a Permutation With Key 81.7% Medium
1410 HTML Entity Parser 54.2% Medium
1411 Number of Ways to Paint N × 3 Grid 60.5% Hard
1412 Find the Quiet Students in All Exams 64.0% Hard
1413 Minimum Value to Get Positive Step by Step Sum 65.5% Easy
1414 Find the Minimum Number of Fibonacci Numbers Whose Sum Is K 63.1% Medium
1415 The k-th Lexicographical String of All Happy Strings of Length n 69.9% Medium
1416 Restore The Array 36.7% Hard
1417 Reformat The String 55.7% Easy
1418 Display Table of Food Orders in a Restaurant 69.1% Medium
1419 Minimum Number of Frogs Croaking 47.6% Medium
1420 Build Array Where You Can Find The Maximum Exactly K Comparisons 64.2% Hard
1421 NPV Queries 82.2% Medium
1422 Maximum Score After Splitting a String 56.7% Easy
1423 Maximum Points You Can Obtain from Cards Go 46.8% Medium
1424 Diagonal Traverse II 46.1% Medium
1425 Constrained Subsequence Sum 44.9% Hard
1426 Counting Elements 59.1% Easy
1427 Perform String Shifts 53.5% Easy
1428 Leftmost Column with at Least a One 49.2% Medium
1429 First Unique Number 49.8% Medium
1430 Check If a String Is a Valid Sequence from Root to Leaves Path in a Binary Tree 45.2% Medium
1431 Kids With the Greatest Number of Candies 88.2% Easy
1432 Max Difference You Can Get From Changing an Integer 42.9% Medium
1433 Check If a String Can Break Another String 67.3% Medium
1434 Number of Ways to Wear Different Hats to Each Other 39.5% Hard
1435 Create a Session Bar Chart 77.9% Easy
1436 Destination City 77.3% Easy
1437 Check If All 1’s Are at Least Length K Places Away Go 62.2% Easy
1438 Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit Go 44.4% Medium
1439 Find the Kth Smallest Sum of a Matrix With Sorted Rows Go 60.1% Hard
1440 Evaluate Boolean Expression 74.9% Medium
1441 Build an Array With Stack Operations 70.3% Easy
1442 Count Triplets That Can Form Two Arrays of Equal XOR 71.7% Medium
1443 Minimum Time to Collect All Apples in a Tree 54.6% Medium
1444 Number of Ways of Cutting a Pizza 53.9% Hard
1445 Apples & Oranges 90.7% Medium
1446 Consecutive Characters 61.1% Easy
1447 Simplified Fractions 62.2% Medium
1448 Count Good Nodes in Binary Tree 71.1% Medium
1449 Form Largest Integer With Digits That Add up to Target 44.2% Hard
1450 Number of Students Doing Homework at a Given Time 77.1% Easy
1451 Rearrange Words in a Sentence 59.7% Medium
1452 People Whose List of Favorite Companies Is Not a Subset of Another List 55.0% Medium
1453 Maximum Number of Darts Inside of a Circular Dartboard 35.4% Hard
1454 Active Users 38.8% Medium
1455 Check If a Word Occurs As a Prefix of Any Word in a Sentence Go 65.2% Easy
1456 Maximum Number of Vowels in a Substring of Given Length 54.7% Medium
1457 Pseudo-Palindromic Paths in a Binary Tree 70.4% Medium
1458 Max Dot Product of Two Subsequences 43.2% Hard
1459 Rectangles Area 65.2% Medium
1460 Make Two Arrays Equal by Reversing Sub-arrays 72.1% Easy
1461 Check If a String Contains All Binary Codes of Size K Go 54.3% Medium
1462 Course Schedule IV 44.8% Medium
1463 Cherry Pickup II Go 69.0% Hard
1464 Maximum Product of Two Elements in an Array Go 77.1% Easy
1465 Maximum Area of a Piece of Cake After Horizontal and Vertical Cuts 33.4% Medium
1466 Reorder Routes to Make All Paths Lead to the City Zero 61.9% Medium
1467 Probability of a Two Boxes Having The Same Number of Distinct Balls 60.9% Hard
1468 Calculate Salaries 82.1% Medium
1469 Find All The Lonely Nodes 80.4% Easy
1470 Shuffle the Array Go 88.2% Easy
1471 The k Strongest Values in an Array 58.5% Medium
1472 Design Browser History 71.6% Medium
1473 Paint House III 48.5% Hard
1474 Delete N Nodes After M Nodes of a Linked List 74.1% Easy
1475 Final Prices With a Special Discount in a Shop 75.1% Easy
1476 Subrectangle Queries 88.1% Medium
1477 Find Two Non-overlapping Sub-arrays Each With Target Sum 34.7% Medium
1478 Allocate Mailboxes 54.0% Hard
1479 Sales by Day of the Week 83.1% Hard
1480 Running Sum of 1d Array Go 88.8% Easy
1481 Least Number of Unique Integers after K Removals 55.9% Medium
1482 Minimum Number of Days to Make m Bouquets 50.4% Medium
1483 Kth Ancestor of a Tree Node 30.8% Hard
1484 Group Sold Products By The Date 85.3% Easy
1485 Clone Binary Tree With Random Pointer 79.3% Medium
1486 XOR Operation in an Array 84.1% Easy
1487 Making File Names Unique 30.8% Medium
1488 Avoid Flood in The City 24.5% Medium
1489 Find Critical and Pseudo-Critical Edges in Minimum Spanning Tree 51.4% Hard
1490 Clone N-ary Tree 83.4% Medium
1491 Average Salary Excluding the Minimum and Maximum Salary 68.5% Easy
1492 The kth Factor of n 63.2% Medium
1493 Longest Subarray of 1’s After Deleting One Element 57.8% Medium
1494 Parallel Courses II 31.1% Hard
1495 Friendly Movies Streamed Last Month 51.2% Easy
1496 Path Crossing 55.2% Easy
1497 Check If Array Pairs Are Divisible by k 40.3% Medium
1498 Number of Subsequences That Satisfy the Given Sum Condition 38.5% Medium
1499 Max Value of Equation 44.9% Hard
1500 Design a File Sharing System 46.7% Medium
1501 Countries You Can Safely Invest In 60.6% Medium
1502 Can Make Arithmetic Progression From Sequence 70.9% Easy
1503 Last Moment Before All Ants Fall Out of a Plank 53.2% Medium
1504 Count Submatrices With All Ones 60.8% Medium
1505 Minimum Possible Integer After at Most K Adjacent Swaps On Digits 36.6% Hard
1506 Find Root of N-Ary Tree 80.3% Medium
1507 Reformat Date 60.1% Easy
1508 Range Sum of Sorted Subarray Sums 60.6% Medium
1509 Minimum Difference Between Largest and Smallest Value in Three Moves 52.4% Medium
1510 Stone Game IV 58.9% Hard
1511 Customer Order Frequency 73.8% Easy
1512 Number of Good Pairs Go 87.7% Easy
1513 Number of Substrings With Only 1s 42.0% Medium
1514 Path with Maximum Probability 40.7% Medium
1515 Best Position for a Service Centre 38.2% Hard
1516 Move Sub-Tree of N-Ary Tree 63.9% Hard
1517 Find Users With Valid E-Mails 71.0% Easy
1518 Water Bottles 60.6% Easy
1519 Number of Nodes in the Sub-Tree With the Same Label 37.1% Medium
1520 Maximum Number of Non-Overlapping Substrings 36.3% Hard
1521 Find a Value of a Mysterious Function Closest to Target 44.2% Hard
1522 Diameter of N-Ary Tree 69.1% Medium
1523 Count Odd Numbers in an Interval Range 54.4% Easy
1524 Number of Sub-arrays With Odd Sum 40.0% Medium
1525 Number of Good Ways to Split a String 66.6% Medium
1526 Minimum Number of Increments on Subarrays to Form a Target Array 60.0% Hard
1527 Patients With a Condition 64.6% Easy
1528 Shuffle String 85.6% Easy
1529 Bulb Switcher IV 70.8% Medium
1530 Number of Good Leaf Nodes Pairs 56.3% Medium
1531 String Compression II 33.9% Hard
1532 The Most Recent Three Orders 72.8% Medium
1533 Find the Index of the Large Integer 54.7% Medium
1534 Count Good Triplets 80.3% Easy
1535 Find the Winner of an Array Game 47.6% Medium
1536 Minimum Swaps to Arrange a Binary Grid 43.6% Medium
1537 Get the Maximum Score 36.4% Hard
1538 Guess the Majority in a Hidden Array 61.2% Medium
1539 Kth Missing Positive Number Go 54.9% Easy
1540 Can Convert String in K Moves 31.0% Medium
1541 Minimum Insertions to Balance a Parentheses String 42.9% Medium
1542 Find Longest Awesome Substring 36.6% Hard
1543 Fix Product Name Format 67.4% Easy
1544 Make The String Great 55.5% Easy
1545 Find Kth Bit in Nth Binary String 57.5% Medium
1546 Maximum Number of Non-Overlapping Subarrays With Sum Equals Target 43.8% Medium
1547 Minimum Cost to Cut a Stick 52.9% Hard
1548 The Most Similar Path in a Graph 54.2% Hard
1549 The Most Recent Orders for Each Product 66.8% Medium
1550 Three Consecutive Odds 64.5% Easy
1551 Minimum Operations to Make Array Equal 77.8% Medium
1552 Magnetic Force Between Two Balls 49.1% Medium
1553 Minimum Number of Days to Eat N Oranges 29.8% Hard
1554 Strings Differ by One Character 63.6% Medium
1555 Bank Account Summary 52.7% Medium
1556 Thousand Separator 57.4% Easy
1557 Minimum Number of Vertices to Reach All Nodes 75.5% Medium
1558 Minimum Numbers of Function Calls to Make Target Array 63.4% Medium
1559 Detect Cycles in 2D Grid 44.4% Hard
1560 Most Visited Sector in a Circular Track 56.9% Easy
1561 Maximum Number of Coins You Can Get 77.3% Medium
1562 Find Latest Group of Size M 39.6% Medium
1563 Stone Game V 39.9% Hard
1564 Put Boxes Into the Warehouse I 66.1% Medium
1565 Unique Orders and Customers Per Month 82.9% Easy
1566 Detect Pattern of Length M Repeated K or More Times 42.5% Easy
1567 Maximum Length of Subarray With Positive Product 36.8% Medium
1568 Minimum Number of Days to Disconnect Island 50.1% Hard
1569 Number of Ways to Reorder Array to Get Same BST 50.0% Hard
1570 Dot Product of Two Sparse Vectors 91.2% Medium
1571 Warehouse Manager 89.8% Easy
1572 Matrix Diagonal Sum 77.7% Easy
1573 Number of Ways to Split a String Go 31.3% Medium
1574 Shortest Subarray to be Removed to Make Array Sorted 33.6% Medium
1575 Count All Possible Routes 57.2% Hard
1576 Replace All ?’s to Avoid Consecutive Repeating Characters 49.1% Easy
1577 Number of Ways Where Square of Number Is Equal to Product of Two Numbers 37.5% Medium
1578 Minimum Deletion Cost to Avoid Repeating Letters 60.5% Medium
1579 Remove Max Number of Edges to Keep Graph Fully Traversable Go 46.2% Hard
1580 Put Boxes Into the Warehouse II 62.0% Medium
1581 Customer Who Visited but Did Not Make Any Transactions 89.7% Easy
1582 Special Positions in a Binary Matrix 64.3% Easy
1583 Count Unhappy Friends 54.8% Medium
1584 Min Cost to Connect All Points 52.5% Medium
1585 Check If String Is Transformable With Substring Sort Operations 48.5% Hard
1586 Binary Search Tree Iterator II 66.7% Medium
1587 Bank Account Summary II 89.8% Easy
1588 Sum of All Odd Length Subarrays 81.6% Easy
1589 Maximum Sum Obtained of Any Permutation 34.9% Medium
1590 Make Sum Divisible by P 26.9% Medium
1591 Strange Printer II 55.1% Hard
1592 Rearrange Spaces Between Words 43.7% Easy
1593 Split a String Into the Max Number of Unique Substrings 49.5% Medium
1594 Maximum Non Negative Product in a Matrix 31.8% Medium
1595 Minimum Cost to Connect Two Groups of Points 43.4% Hard
1596 The Most Frequently Ordered Products for Each Customer 84.8% Medium
1597 Build Binary Expression Tree From Infix Expression 59.4% Hard
1598 Crawler Log Folder 63.8% Easy
1599 Maximum Profit of Operating a Centennial Wheel 43.7% Medium
1600 Throne Inheritance 60.4% Medium
1601 Maximum Number of Achievable Transfer Requests 47.7% Hard
1602 Find Nearest Right Node in Binary Tree 73.7% Medium
1603 Design Parking System Go 86.2% Easy
1604 Alert Using Same Key-Card Three or More Times in a One Hour Period 42.7% Medium
1605 Find Valid Matrix Given Row and Column Sums 77.2% Medium
1606 Find Servers That Handled Most Number of Requests 37.2% Hard
1607 Sellers With No Sales 55.4% Easy
1608 Special Array With X Elements Greater Than or Equal X Go 61.4% Easy
1609 Even Odd Tree 52.5% Medium
1610 Maximum Number of Visible Points 30.2% Hard
1611 Minimum One Bit Operations to Make Integers Zero 57.3% Hard
1612 Check If Two Expression Trees are Equivalent 70.0% Medium
1613 Find the Missing IDs 74.2% Medium
1614 Maximum Nesting Depth of the Parentheses Go 82.8% Easy
1615 Maximal Network Rank 52.4% Medium
1616 Split Two Strings to Make Palindrome 36.1% Medium
1617 Count Subtrees With Max Distance Between Cities 63.2% Hard
1618 Maximum Font to Fit a Sentence in a Screen 56.5% Medium
1619 Mean of Array After Removing Some Elements Go 64.8% Easy
1620 Coordinate With Maximum Network Quality 37.1% Medium
1621 Number of Sets of K Non-Overlapping Line Segments 41.3% Medium
1622 Fancy Sequence 15.0% Hard
1623 All Valid Triplets That Can Represent a Country 88.8% Easy
1624 Largest Substring Between Two Equal Characters Go 58.7% Easy
1625 Lexicographically Smallest String After Applying Operations 64.4% Medium
1626 Best Team With No Conflicts 38.2% Medium
1627 Graph Connectivity With Threshold 39.4% Hard
1628 Design an Expression Tree With Evaluate Function 80.5% Medium
1629 Slowest Key Go 59.1% Easy
1630 Arithmetic Subarrays 77.6% Medium
1631 Path With Minimum Effort Go 50.0% Medium
1632 Rank Transform of a Matrix 30.8% Hard
1633 Percentage of Users Attended a Contest 71.2% Easy
1634 Add Two Polynomials Represented as Linked Lists 55.1% Medium
1635 Hopper Company Queries I 55.9% Hard
1636 Sort Array by Increasing Frequency Go 66.8% Easy
1637 Widest Vertical Area Between Two Points Containing No Points 83.6% Medium
1638 Count Substrings That Differ by One Character 69.6% Medium
1639 Number of Ways to Form a Target String Given a Dictionary 40.0% Hard
1640 Check Array Formation Through Concatenation Go 59.8% Easy
1641 Count Sorted Vowel Strings Go 76.1% Medium
1642 Furthest Building You Can Reach 50.2% Medium
1643 Kth Smallest Instructions 44.1% Hard
1644 Lowest Common Ancestor of a Binary Tree II 56.3% Medium
1645 Hopper Company Queries II 38.1% Hard
1646 Get Maximum in Generated Array Go 53.3% Easy
1647 Minimum Deletions to Make Character Frequencies Unique Go 54.8% Medium
1648 Sell Diminishing-Valued Colored Balls Go 30.5% Medium
1649 Create Sorted Array through Instructions Go 36.4% Hard
1650 Lowest Common Ancestor of a Binary Tree III 76.4% Medium
1651 Hopper Company Queries III 66.9% Hard
1652 Defuse the Bomb Go 62.3% Easy
1653 Minimum Deletions to Make String Balanced Go 51.4% Medium
1654 Minimum Jumps to Reach Home Go 25.5% Medium
1655 Distribute Repeating Integers Go 39.9% Hard
1656 Design an Ordered Stream Go 82.1% Easy
1657 Determine if Two Strings Are Close Go 55.3% Medium
1658 Minimum Operations to Reduce X to Zero Go 33.3% Medium
1659 Maximize Grid Happiness Go 35.5% Hard
1660 Correct a Binary Tree 76.9% Medium
1661 Average Time of Process per Machine 79.5% Easy
1662 Check If Two String Arrays are Equivalent Go 82.7% Easy
1663 Smallest String With A Given Numeric Value Go 64.3% Medium
1664 Ways to Make a Fair Array Go 62.1% Medium
1665 Minimum Initial Energy to Finish Tasks Go 65.4% Hard
1666 Change the Root of a Binary Tree 68.0% Medium
1667 Fix Names in a Table 62.9% Easy
1668 Maximum Repeating Substring Go 38.7% Easy
1669 Merge In Between Linked Lists Go 75.9% Medium
1670 Design Front Middle Back Queue Go 54.2% Medium
1671 Minimum Number of Removals to Make Mountain Array 45.7% Hard
1672 Richest Customer Wealth Go 88.2% Easy
1673 Find the Most Competitive Subsequence Go 45.5% Medium
1674 Minimum Moves to Make Array Complementary Go 34.8% Medium
1675 Minimize Deviation in Array Go 48.3% Hard
1676 Lowest Common Ancestor of a Binary Tree IV 79.1% Medium
1677 Product’s Worth Over Invoices 73.1% Easy
1678 Goal Parser Interpretation Go 85.4% Easy
1679 Max Number of K-Sum Pairs Go 53.9% Medium
1680 Concatenation of Consecutive Binary Numbers Go 52.3% Medium
1681 Minimum Incompatibility Go 35.7% Hard
1682 Longest Palindromic Subsequence II 51.8% Medium
1683 Invalid Tweets 90.9% Easy
1684 Count the Number of Consistent Strings Go 82.1% Easy
1685 Sum of Absolute Differences in a Sorted Array Go 62.9% Medium
1686 Stone Game VI 49.7% Medium
1687 Delivering Boxes from Storage to Ports 35.0% Hard
1688 Count of Matches in Tournament Go 81.5% Easy
1689 Partitioning Into Minimum Number Of Deci-Binary Numbers Go 87.2% Medium
1690 Stone Game VII Go 48.6% Medium
1691 Maximum Height by Stacking Cuboids Go 50.2% Hard
1692 Count Ways to Distribute Candies 62.6% Hard
1693 Daily Leads and Partners 90.8% Easy
1694 Reformat Phone Number Go 65.6% Easy
1695 Maximum Erasure Value Go 49.5% Medium
1696 Jump Game VI Go 52.4% Medium
1697 Checking Existence of Edge Length Limited Paths 54.5% Hard
1698 Number of Distinct Substrings in a String 60.4% Medium
1699 Number of Calls Between Two Persons 86.6% Medium
1700 Number of Students Unable to Eat Lunch Go 68.1% Easy
1701 Average Waiting Time 61.5% Medium
1702 Maximum Binary String After Change 59.8% Medium
1703 Minimum Adjacent Swaps for K Consecutive Ones 39.9% Hard
1704 Determine if String Halves Are Alike Go 77.0% Easy
1705 Maximum Number of Eaten Apples 41.9% Medium
1706 Where Will the Ball Fall 60.1% Medium
1707 Maximum XOR With an Element From Array 46.3% Hard
1708 Largest Subarray Length K 63.1% Easy
1709 Biggest Window Between Visits 82.7% Medium
1710 Maximum Units on a Truck Go 70.1% Easy
1711 Count Good Meals 26.1% Medium
1712 Ways to Split Array Into Three Subarrays 29.5% Medium
1713 Minimum Operations to Make a Subsequence 45.6% Hard
1714 Sum Of Special Evenly-Spaced Elements In Array 48.2% Hard
1715 Count Apples and Oranges 79.2% Medium
1716 Calculate Money in Leetcode Bank Go 66.3% Easy
1717 Maximum Score From Removing Substrings 40.5% Medium
1718 Construct the Lexicographically Largest Valid Sequence 46.1% Medium
1719 Number Of Ways To Reconstruct A Tree 39.5% Hard
1720 Decode XORed Array Go 85.3% Easy
1721 Swapping Nodes in a Linked List Go 68.2% Medium
1722 Minimize Hamming Distance After Swap Operations 54.3% Medium
1723 Find Minimum Time to Finish All Jobs 43.7% Hard
1724 Checking Existence of Edge Length Limited Paths II 56.5% Hard
1725 Number Of Rectangles That Can Form The Largest Square Go 77.9% Easy
1726 Tuple with Same Product 56.4% Medium
1727 Largest Submatrix With Rearrangements 58.6% Medium
1728 Cat and Mouse II 40.9% Hard
1729 Find Followers Count 71.6% Easy
1730 Shortest Path to Get Food 56.6% Medium
1731 The Number of Employees Which Report to Each Employee 49.1% Easy
1732 Find the Highest Altitude Go 80.3% Easy
1733 Minimum Number of People to Teach 37.4% Medium
1734 Decode XORed Permutation 53.4% Medium
1735 Count Ways to Make Array With Product 48.1% Hard
1736 Latest Time by Replacing Hidden Digits Go 41.2% Easy
1737 Change Minimum Characters to Satisfy One of Three Conditions 29.7% Medium
1738 Find Kth Largest XOR Coordinate Value 62.5% Medium
1739 Building Boxes 49.6% Hard
1740 Find Distance in a Binary Tree 68.5% Medium
1741 Find Total Time Spent by Each Employee 91.2% Easy
1742 Maximum Number of Balls in a Box Go 74.4% Easy
1743 Restore the Array From Adjacent Pairs 63.0% Medium
1744 Can You Eat Your Favorite Candy on Your Favorite Day? 30.5% Medium
1745 Palindrome Partitioning IV 49.3% Hard
1746 Maximum Subarray Sum After One Operation 61.7% Medium
1747 Leetflex Banned Accounts 69.9% Medium
1748 Sum of Unique Elements Go 75.1% Easy
1749 Maximum Absolute Sum of Any Subarray 52.0% Medium
1750 Minimum Length of String After Deleting Similar Ends 42.6% Medium
1751 Maximum Number of Events That Can Be Attended II 47.8% Hard
1752 Check if Array Is Sorted and Rotated Go 62.2% Easy
1753 Maximum Score From Removing Stones 61.4% Medium
1754 Largest Merge Of Two Strings 40.3% Medium
1755 Closest Subsequence Sum 35.6% Hard
1756 Design Most Recently Used Queue 78.1% Medium
1757 Recyclable and Low Fat Products 96.2% Easy
1758 Minimum Changes To Make Alternating Binary String Go 58.6% Easy
1759 Count Number of Homogenous Substrings 42.2% Medium
1760 Minimum Limit of Balls in a Bag 52.5% Medium
1761 Minimum Degree of a Connected Trio in a Graph 37.3% Hard
1762 Buildings With an Ocean View 81.0% Medium
1763 Longest Nice Substring 61.4% Easy
1764 Form Array by Concatenating Subarrays of Another Array 55.1% Medium
1765 Map of Highest Peak 54.8% Medium
1766 Tree of Coprimes 36.7% Hard
1767 Find the Subtasks That Did Not Execute 88.1% Hard
1768 Merge Strings Alternately 76.7% Easy
1769 Minimum Number of Operations to Move All Balls to Each Box 87.4% Medium
1770 Maximum Score from Performing Multiplication Operations 29.1% Medium
1771 Maximize Palindrome Length From Subsequences 34.1% Hard
1772 Sort Features by Popularity 64.6% Medium
1773 Count Items Matching a Rule 85.7% Easy
1774 Closest Dessert Cost 59.2% Medium
1775 Equal Sum Arrays With Minimum Number of Operations 50.8% Medium
1776 Car Fleet II 44.8% Hard
1777 Product’s Price for Each Store 87.8% Easy
1778 Shortest Path in a Hidden Grid 47.5% Medium
1779 Find Nearest Point That Has the Same X or Y Coordinate 67.8% Easy
1780 Check if Number is a Sum of Powers of Three 63.2% Medium
1781 Sum of Beauty of All Substrings 57.2% Medium
1782 Count Pairs Of Nodes 31.6% Hard
1783 Grand Slam Titles 91.5% Medium
1784 Check if Binary String Has at Most One Segment of Ones 41.6% Easy
1785 Minimum Elements to Add to Form a Given Sum 38.9% Medium
1786 Number of Restricted Paths From First to Last Node 35.9% Medium
1787 Make the XOR of All Segments Equal to Zero 35.8% Hard
1788 Maximize the Beauty of the Garden 70.4% Hard
1789 Primary Department for Each Employee 77.9% Easy
1790 Check if One String Swap Can Make Strings Equal 64.4% Easy
1791 Find Center of Star Graph 85.8% Medium
1792 Maximum Average Pass Ratio 56.7% Medium
1793 Maximum Score of a Good Subarray 45.3% Hard
1794 Count Pairs of Equal Substrings With Minimum Difference 69.7% Medium
1795 Rearrange Products Table 92.4% Easy
1796 Second Largest Digit in a String 46.7% Easy
1797 Design Authentication Manager 46.4% Medium
1798 Maximum Number of Consecutive Values You Can Make 37.2% Medium
1799 Maximize Score After N Operations 40.2% Hard
1800 Maximum Ascending Subarray Sum 67.4% Easy
1801 Number of Orders in the Backlog 41.4% Medium
1802 Maximum Value at a Given Index in a Bounded Array 23.5% Medium
1803 Count Pairs With XOR in a Range 29.8% Hard

2、leetcode题目分类

Array

No. Title Solution Difficulty Time Space
0001 Two Sum Go Easy O(n) O(n)
0004 Median of Two Sorted Arrays Go Hard
0011 Container With Most Water Go Medium O(n) O(1)
0015 3Sum Go Medium O(n^2) O(n)
0016 3Sum Closest Go Medium O(n^2) O(1)
0018 4Sum Go Medium O(n^3) O(n^2)
0026 Remove Duplicates from Sorted Array Go Easy O(n) O(1)
0027 Remove Element Go Easy O(n) O(1)
0031 Next Permutation Go Medium
0033 Search in Rotated Sorted Array Go Medium
0034 Find First and Last Position of Element in Sorted Array Go Medium
0035 Search Insert Position Go Easy
0039 Combination Sum Go Medium O(n log n) O(n)
0040 Combination Sum II Go Medium O(n log n) O(n)
0041 First Missing Positive Go Hard O(n) O(n)
0042 Trapping Rain Water Go Hard O(n) O(1)
0045 Jump Game II Go Medium
0048 Rotate Image Go Medium O(n) O(1)
0053 Maximum Subarray Go Easy O(n) O(n)
0054 Spiral Matrix Go Medium O(n) O(n^2)
0056 Merge Intervals Go Medium O(n log n) O(1)
0057 Insert Interval Go Hard O(n) O(1)
0059 Spiral Matrix II Go Medium O(n) O(n^2)
0062 Unique Paths Go Medium O(n^2) O(n^2)
0063 Unique Paths II Go Medium O(n^2) O(n^2)
0064 Minimum Path Sum Go Medium O(n^2) O(n^2)
0066 Plus One Go Easy
0073 Set Matrix Zeroes Go Medium
0074 Search a 2D Matrix Go Medium
0075 Sort Colors Go Medium O(n) O(1)
0078 Subsets Go Medium O(n^2) O(n)
0079 Word Search Go Medium O(n^2) O(n^2)
0080 Remove Duplicates from Sorted Array II Go Medium O(n^2) O(n^2)
0081 Search in Rotated Sorted Array II Go Medium
0084 Largest Rectangle in Histogram Go Medium O(n) O(n)
0088 Merge Sorted Array Go Easy O(n) O(1)
0090 Subsets II Go Medium O(n^2) O(n)
0105 Construct Binary Tree from Preorder and Inorder Traversal Go Medium
0106 Construct Binary Tree from Inorder and Postorder Traversal Go Medium
0118 Pascal’s Triangle Go Easy
0119 Pascal’s Triangle II Go Easy
0120 Triangle Go Medium O(n^2) O(n)
0121 Best Time to Buy and Sell Stock Go Easy O(n) O(1)
0122 Best Time to Buy and Sell Stock II Go Easy O(n) O(1)
0126 Word Ladder II Go Hard O(n) O(n^2)
0128 Longest Consecutive Sequence Go Hard
0152 Maximum Product Subarray Go Medium O(n) O(1)
0153 Find Minimum in Rotated Sorted Array Go Medium
0154 Find Minimum in Rotated Sorted Array II Go Hard
0162 Find Peak Element Go Medium
0167 Two Sum II - Input array is sorted Go Easy O(n) O(1)
0169 Majority Element Go Easy
0189 Rotate Array Go Medium
0209 Minimum Size Subarray Sum Go Medium O(n) O(1)
0216 Combination Sum III Go Medium O(n) O(1)
0217 Contains Duplicate Go Easy O(n) O(n)
0219 Contains Duplicate II Go Easy O(n) O(n)
0228 Summary Ranges Go Easy
0229 Majority Element II Go Medium
0268 Missing Number Go Easy
0283 Move Zeroes Go Easy O(n) O(1)
0287 Find the Duplicate Number Go Easy O(n) O(1)
0414 Third Maximum Number Go Easy
0448 Find All Numbers Disappeared in an Array Go Easy
0457 Circular Array Loop Go Medium
0485 Max Consecutive Ones Go Easy
0509 Fibonacci Number Go Easy
0532 K-diff Pairs in an Array Go Easy O(n) O(n)
0561 Array Partition I Go Easy
0566 Reshape the Matrix Go Easy O(n^2) O(n^2)
0581 Shortest Unsorted Continuous Subarray Go Medium
0605 Can Place Flowers Go Easy
0628 Maximum Product of Three Numbers Go Easy O(n) O(1)
0643 Maximum Average Subarray I Go Easy
0661 Image Smoother Go Easy
0665 Non-decreasing Array Go Medium
0674 Longest Continuous Increasing Subsequence Go Easy
0695 Max Area of Island Go Medium
0697 Degree of an Array Go Easy
0713 Subarray Product Less Than K Go Medium O(n) O(1)
0714 Best Time to Buy and Sell Stock with Transaction Fee Go Medium O(n) O(1)
0717 1-bit and 2-bit Characters Go Easy
0718 Maximum Length of Repeated Subarray Go Medium
0719 Find K-th Smallest Pair Distance Go Hard
0724 Find Pivot Index Go Easy
0729 My Calendar I Go Medium
0746 Min Cost Climbing Stairs Go Easy O(n) O(1)
0766 Toeplitz Matrix Go Easy O(n) O(1)
0830 Positions of Large Groups Go Easy
0832 Flipping an Image Go Easy
0867 Transpose Matrix Go Easy O(n) O(1)
0888 Fair Candy Swap Go Easy
0891 Sum of Subsequence Widths Go Hard O(n) O(1)
0896 Monotonic Array Go Easy
0907 Sum of Subarray Minimums Go Medium O(n) O(1)
0914 X of a Kind in a Deck of Cards Go Easy
0918 Maximum Sum Circular Subarray Go Medium
0922 Sort Array By Parity II Go Medium O(n) O(1)
0969 Pancake Sorting Go Medium O(n) O(1)
0977 Squares of a Sorted Array Go Easy O(n) O(1)
0978 Longest Turbulent Subarray Go Medium
0985 Sum of Even Numbers After Queries Go Easy
0989 Add to Array-Form of Integer Go Easy
0999 Available Captures for Rook Go Easy
1002 Find Common Characters Go Easy
1011 Capacity To Ship Packages Within D Days Go Medium
1018 Binary Prefix Divisible By 5 Go Easy
1040 Moving Stones Until Consecutive II Go Medium
1051 Height Checker Go Easy
1052 Grumpy Bookstore Owner Go Medium
1074 Number of Submatrices That Sum to Target Go Hard
1089 Duplicate Zeros Go Easy
1122 Relative Sort Array Go Easy
1128 Number of Equivalent Domino Pairs Go Easy
1157 Online Majority Element In Subarray Go Hard
1160 Find Words That Can Be Formed by Characters Go Easy
1170 Compare Strings by Frequency of the Smallest Character Go Medium
1184 Distance Between Bus Stops Go Easy
1185 Day of the Week Go Easy
1200 Minimum Absolute Difference Go Easy
1202 Smallest String With Swaps Go Medium
1208 Get Equal Substrings Within Budget Go Medium
1217 Minimum Cost to Move Chips to The Same Position Go Easy
1232 Check If It Is a Straight Line Go Easy
1252 Cells with Odd Values in a Matrix Go Easy
1260 Shift 2D Grid Go Easy
1266 Minimum Time Visiting All Points Go Easy
1275 Find Winner on a Tic Tac Toe Game Go Easy
1287 Element Appearing More Than 25% In Sorted Array Go Easy
1295 Find Numbers with Even Number of Digits Go Easy
1299 Replace Elements with Greatest Element on Right Side Go Easy
1300 Sum of Mutated Array Closest to Target Go Medium
1304 Find N Unique Integers Sum up to Zero Go Easy
1313 Decompress Run-Length Encoded List Go Easy
1329 Sort the Matrix Diagonally Go Medium
1337 The K Weakest Rows in a Matrix Go Easy
1380 Lucky Numbers in a Matrix Go Easy
1385 Find the Distance Value Between Two Arrays Go Easy
1389 Create Target Array in the Given Order Go Easy
1423 Maximum Points You Can Obtain from Cards Go Medium
1437 Check If All 1’s Are at Least Length K Places Away Go Easy
1438 Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit Go Medium
1464 Maximum Product of Two Elements in an Array Go Easy
1470 Shuffle the Array Go Easy
1480 Running Sum of 1d Array Go Easy
1512 Number of Good Pairs Go Easy
1539 Kth Missing Positive Number Go Easy
1608 Special Array With X Elements Greater Than or Equal X Go Easy
1619 Mean of Array After Removing Some Elements Go Easy
1629 Slowest Key Go Easy
1636 Sort Array by Increasing Frequency Go Easy
1640 Check Array Formation Through Concatenation Go Easy
1646 Get Maximum in Generated Array Go Easy
1652 Defuse the Bomb Go Easy
1656 Design an Ordered Stream Go Easy
1672 Richest Customer Wealth Go Easy
1700 Number of Students Unable to Eat Lunch Go Easy
1711 Count Good Meals Medium
1732 Find the Highest Altitude Go Easy
1738 Find Kth Largest XOR Coordinat
1742 Maximum Number of Balls in a Box Go Easy
1748 Sum of Unique Elements Go Easy
1752 Check if Array Is Sorted and Rotated Go Easy
1758 Minimum Changes To Make Alternating Binary String Go Easy

String

No. Title Solution Difficulty Time Space Acceptance
0003 Longest Substring Without Repeating Characters Go Medium O(n) O(1) 31.5%
0005 Longest Palindromic Substring Go Medium 30.6%
0006 ZigZag Conversion Go Medium 38.1%
0008 String to Integer (atoi) Go Medium 15.7%
0012 Integer to Roman Go Medium 57.0%
0013 Roman to Integer Go Easy 56.9%
0017 Letter Combinations of a Phone Number Go Medium O(log n) O(1) 49.4%
0020 Valid Parentheses Go Easy O(log n) O(1) 39.9%
0022 Generate Parentheses Go Medium O(log n) O(1) 65.6%
0028 Implement strStr() Go Easy O(n) O(1) 35.3%
0030 Substring with Concatenation of All Words Go Hard O(n) O(n) 26.3%
0043 Multiply Strings Go Medium 35.0%
0049 Group Anagrams Go Medium O(n log n) O(n) 59.5%
0067 Add Binary Go Easy 47.1%
0071 Simplify Path Go Medium O(n) O(n) 34.8%
0076 Minimum Window Substring Go Hard O(n) O(n) 36.1%
0091 Decode Ways Go Medium O(n) O(n) 26.8%
0093 Restore IP Addresses Go Medium O(n) O(n) 37.7%
0115 Distinct Subsequences Go Hard 39.9%
0125 Valid Palindrome Go Easy O(n) O(1) 38.4%
0126 Word Ladder II Go Hard O(n) O(n^2) 23.9%
0151 Reverse Words in a String Go Medium 24.0%
0227 Basic Calculator II Go Medium 38.7%
0344 Reverse String Go Easy O(n) O(1) 70.5%
0345 Reverse Vowels of a String Go Easy O(n) O(1) 45.1%
0385 Mini Parser Go Medium 34.5%
0387 First Unique Character in a String Go Easy 53.8%
0537 Complex Number Multiplication Go Medium 68.3%
0541 Reverse String II Go Easy 49.3%
0557 Reverse Words in a String III Go Easy 72.2%
0632 Smallest Range Covering Elements from K Lists Go Hard 54.4%
0767 Reorganize String Go Medium O(n log n) O(log n) 50.2%
0819 Most Common Word Go Easy 45.5%
0842 Split Array into Fibonacci Sequence Go Medium O(n^2) O(1) 37.0%
0856 Score of Parentheses Go Medium O(n) O(n) 64.9%
0925 Long Pressed Name Go Easy O(n) O(1) 37.7%
0966 Vowel Spellchecker Go Medium 50.3%
1003 Check If Word Is Valid After Substitutions Go Medium O(n) O(1) 56.5%
1108 Defanging an IP Address Go Easy 88.4%
1170 Compare Strings by Frequency of the Smallest Character Go Medium 60.1%
1189 Maximum Number of Balloons Go Easy 62.1%
1221 Split a String in Balanced Strings Go Easy 84.3%
1234 Replace the Substring for Balanced String Go Medium 34.5%
1249 Minimum Remove to Make Valid Parentheses Go Medium 64.2%
1332 Remove Palindromic Subsequences Go Easy 68.1%
1455 Check If a Word Occurs As a Prefix of Any Word in a Sentence Go Easy 65.2%
1461 Check If a String Contains All Binary Codes of Size K Go Medium 54.3%
1573 Number of Ways to Split a String Go Medium 31.3%
1614 Maximum Nesting Depth of the Parentheses Go Easy 82.8%
1624 Largest Substring Between Two Equal Characters Go Easy 58.7%
1653 Minimum Deletions to Make String Balanced Go Medium 51.4%
1662 Check If Two String Arrays are Equivalent Go Easy 82.7%
1668 Maximum Repeating Substring Go Easy 38.7%
1678 Goal Parser Interpretation Go Easy 85.3%
1684 Count the Number of Consistent Strings Go Easy 82.1%
1694 Reformat Phone Number Go Easy 65.6%
1704 Determine if String Halves Are Alike Go Easy 77.0%
1736 Latest Time by Replacing Hidden Digits Go Easy 41.2%

Two_Pointers

  • 双指针滑动窗口的经典写法。右指针不断往右移,移动到不能往右移动为止(具体条件根据题目而定)。当右指针到最右边以后,开始挪动左指针,释放窗口左边界。第 3 题,第 76 题,第 209 题,第 424 题,第 438 题,第 567 题,第 713 题,第 763 题,第 845 题,第 881 题,第 904 题,第 978 题,第 992 题,第 1004 题,第 1040 题,第 1052 题。
    left, right := 0, -1

    for left < len(s) {
        if right+1 < len(s) && freq[s[right+1]-'a'] == 0 {
            freq[s[right+1]-'a']++
            right++
        } else {
            freq[s[left]-'a']--
            left++
        }
        result = max(result, right-left+1)
    }
  • 快慢指针可以查找重复数字,时间复杂度 O(n),第 287 题。
  • 替换字母以后,相同字母能出现连续最长的长度。第 424 题。
  • SUM 问题集。第 1 题,第 15 题,第 16 题,第 18 题,第 167 题,第 923 题,第 1074 题。
No. Title Solution Difficulty Time Space Favorite Acceptance
0003 Longest Substring Without Repeating Characters Go Medium O(n) O(1) ❤️ 31.5%
0011 Container With Most Water Go Medium O(n) O(1) 52.8%
0015 3Sum Go Medium O(n^2) O(n) ❤️ 28.2%
0016 3Sum Closest Go Medium O(n^2) O(1) ❤️ 46.3%
0018 4Sum Go Medium O(n^3) O(n^2) ❤️ 35.0%
0019 Remove Nth Node From End of List Go Medium O(n) O(1) 35.8%
0026 Remove Duplicates from Sorted Array Go Easy O(n) O(1) 46.7%
0027 Remove Element Go Easy O(n) O(1) 49.4%
0028 Implement strStr() Go Easy O(n) O(1) 35.3%
0030 Substring with Concatenation of All Words Go Hard O(n) O(n) ❤️ 26.3%
0042 Trapping Rain Water Go Hard O(n) O(1) ❤️ 51.4%
0061 Rotate List Go Medium O(n) O(1) 31.9%
0075 Sort Colors Go Medium O(n) O(1) ❤️ 49.6%
0076 Minimum Window Substring Go Hard O(n) O(n) ❤️ 36.1%
0080 Remove Duplicates from Sorted Array II Go Medium O(n) O(1 46.2%
0086 Partition List Go Medium O(n) O(1) ❤️ 43.6%
0088 Merge Sorted Array Go Easy O(n) O(1) ❤️ 40.8%
0125 Valid Palindrome Go Easy O(n) O(1) 38.4%
0141 Linked List Cycle Go Easy O(n) O(1) ❤️ 43.0%
0142 Linked List Cycle II Go Medium O(n) O(1) ❤️ 39.9%
0167 Two Sum II - Input array is sorted Go Easy O(n) O(1) 55.7%
0209 Minimum Size Subarray Sum Go Medium O(n) O(1) 39.6%
0234 Palindrome Linked List Go Easy O(n) O(1) 40.8%
0283 Move Zeroes Go Easy O(n) O(1) 58.6%
0287 Find the Duplicate Number Go Medium O(n) O(1) ❤️ 57.7%
0344 Reverse String Go Easy O(n) O(1) 70.5%
0345 Reverse Vowels of a String Go Easy O(n) O(1) 45.1%
0349 Intersection of Two Arrays Go Easy O(n) O(n) 65.0%
0350 Intersection of Two Arrays II Go Easy O(n) O(n) 52.0%
0424 Longest Repeating Character Replacement Go Medium O(n) O(1) 48.3%
0457 Circular Array Loop Go Medium 30.3%
0524 Longest Word in Dictionary through Deleting Go Medium O(n) O(1) 50.1%
0532 K-diff Pairs in an Array Go Medium O(n) O(n) 35.4%
0567 Permutation in String Go Medium O(n) O(1) ❤️ 44.6%
0632 Smallest Range Covering Elements from K Lists Go Hard 54.4%
0713 Subarray Product Less Than K Go Medium O(n) O(1) 40.5%
0763 Partition Labels Go Medium O(n) O(1) ❤️ 78.1%
0826 Most Profit Assigning Work Go Medium O(n log n) O(n) 39.2%
0828 Count Unique Characters of All Substrings of a Given String Go Hard O(n) O(1) ❤️ 46.8%
0838 Push Dominoes Go Medium O(n) O(n) 49.9%
0844 Backspace String Compare Go Easy O(n) O(n) 47.1%
0845 Longest Mountain in Array Go Medium O(n) O(1) 38.6%
0881 Boats to Save People Go Medium O(n log n) O(1) 49.0%
0904 Fruit Into Baskets Go Medium O(n log n) O(1) 43.0%
0923 3Sum With Multiplicity Go Medium O(n^2) O(n) 36.3%
0925 Long Pressed Name Go Easy O(n) O(1) 37.7%
0930 Binary Subarrays With Sum Go Medium O(n) O(n) ❤️ 44.7%
0977 Squares of a Sorted Array Go Easy O(n) O(1) 71.9%
0986 Interval List Intersections Go Medium O(n) O(1) 68.4%
0992 Subarrays with K Different Integers Go Hard O(n) O(n) ❤️ 50.8%
1004 Max Consecutive Ones III Go Medium O(n) O(1) 60.9%
1093 Statistics from a Large Sample Go Medium O(n) O(1) 49.1%
1234 Replace the Substring for Balanced String Go Medium 34.5%
1658 Minimum Operations to Reduce X to Zero Go Medium 33.3%
1695 Maximum Erasure Value Go Medium 49.5%

Linked List (已全部做完)

  • 巧妙的构造虚拟头结点。可以使遍历处理逻辑更加统一。
  • 灵活使用递归。构造递归条件,使用递归可以巧妙的解题。不过需要注意有些题目不能使用递归,因为递归深度太深会导致超时和栈溢出。
  • 链表区间逆序。第 92 题。
  • 链表寻找中间节点。第 876 题。链表寻找倒数第 n 个节点。第 19 题。只需要一次遍历就可以得到答案。
  • 合并 K 个有序链表。第 21 题,第 23 题。
  • 链表归类。第 86 题,第 328 题。
  • 链表排序,时间复杂度要求 O(n * log n),空间复杂度 O(1)。只有一种做法,归并排序,至顶向下归并。第 148 题。
  • 判断链表是否存在环,如果有环,输出环的交叉点的下标;判断 2 个链表是否有交叉点,如果有交叉点,输出交叉点。第 141 题,第 142 题,第 160 题。
No. Title Solution Difficulty Time Space Acceptance
0002 Add Two Numbers Go Medium O(n) O(1) 35.6%
0019 Remove Nth Node From End of List Go Medium O(n) O(1) 35.8%
0021 Merge Two Sorted Lists Go Easy O(log n) O(1) 56.2%
0023 Merge k Sorted Lists Go Hard O(log n) O(1) 42.9%
0024 Swap Nodes in Pairs Go Medium O(n) O(1) 53.3%
0025 Reverse Nodes in k-Group Go Hard O(log n) O(1) 45.1%
0061 Rotate List Go Medium O(n) O(1) 31.9%
0082 Remove Duplicates from Sorted List II Go Medium O(n) O(1) 39.4%
0083 Remove Duplicates from Sorted List Go Easy O(n) O(1) 46.6%
0086 Partition List Go Medium O(n) O(1) 43.6%
0092 Reverse Linked List II Go Medium O(n) O(1) 40.7%
0109 Convert Sorted List to Binary Search Tree Go Medium O(log n) O(n) 50.4%
0138 Copy List with Random Pointer Go Medium 41.2%
0141 Linked List Cycle Go Easy O(n) O(1) 43.0%
0142 Linked List Cycle II Go Medium O(n) O(1) 39.9%
0143 Reorder List Go Medium O(n) O(1) 40.8%
0147 Insertion Sort List Go Medium O(n) O(1) 44.5%
0148 Sort List Go Medium O(n log n) O(n) 46.5%
0160 Intersection of Two Linked Lists Go Easy O(n) O(1) 44.3%
0203 Remove Linked List Elements Go Easy O(n) O(1) 39.3%
0206 Reverse Linked List Go Easy O(n) O(1) 65.5%
0234 Palindrome Linked List Go Easy O(n) O(1) 40.8%
0237 Delete Node in a Linked List Go Easy O(n) O(1) 67.2%
0328 Odd Even Linked List Go Medium O(n) O(1) 57.2%
0445 Add Two Numbers II Go Medium O(n) O(n) 56.4%
0707 Design Linked List Go Medium O(n) O(1) 26.0%
0725 Split Linked List in Parts Go Medium O(n) O(1) 53.1%
0817 Linked List Components Go Medium O(n) O(1) 57.8%
0876 Middle of the Linked List Go Easy O(n) O(1) 69.2%
1019 Next Greater Node In Linked List Go Medium O(n) O(1) 58.3%
1171 Remove Zero Sum Consecutive Nodes from Linked List Go Medium 41.5%
1290 Convert Binary Number in a Linked List to Integer Go Easy 81.8%
1669 Merge In Between Linked Lists Go Medium 75.9%
1670 Design Front Middle Back Queue Go Medium 54.2%
1721 Swapping Nodes in a Linked List Go Medium 68.2%

Stack (已全部做完)

  • 括号匹配问题及类似问题。第 20 题,第 921 题,第 1021 题。
  • 栈的基本 pop 和 push 操作。第 71 题,第 150 题,第 155 题,第 224 题,第 225 题,第 232 题,第 946 题,第 1047 题。
  • 利用栈进行编码问题。第 394 题,第 682 题,第 856 题,第 880 题。
  • 单调栈利用栈维护一个单调递增或者递减的下标数组。第 84 题,第 456 题,第 496 题,第 503 题,第 739 题,第 901 题,第 907 题,第 1019 题。
No. Title Solution Difficulty Time Space Acceptance
0020 Valid Parentheses Go Easy O(log n) O(1) 39.9%
0042 Trapping Rain Water Go Hard O(n) O(1) 51.4%
0071 Simplify Path Go Medium O(n) O(n) 34.8%
0084 Largest Rectangle in Histogram Go Hard O(n) O(n) 37.3%
0094 Binary Tree Inorder Traversal Go Medium O(n) O(1) 66.1%
0103 Binary Tree Zigzag Level Order Traversal Go Medium O(n) O(n) 50.3%
0144 Binary Tree Preorder Traversal Go Medium O(n) O(1) 57.7%
0145 Binary Tree Postorder Traversal Go Medium O(n) O(1) 57.8%
0150 Evaluate Reverse Polish Notation Go Medium O(n) O(1) 38.1%
0155 Min Stack Go Easy O(n) O(n) 46.6%
0173 Binary Search Tree Iterator Go Medium O(n) O(1) 60.4%
0224 Basic Calculator Go Hard O(n) O(n) 38.2%
0225 Implement Stack using Queues Go Easy O(n) O(n) 47.7%
0227 Basic Calculator II Go Medium 38.6%
0232 Implement Queue using Stacks Go Easy O(n) O(n) 52.5%
0331 Verify Preorder Serialization of a Binary Tree Go Medium O(n) O(1) 41.1%
0385 Mini Parser Go Medium 34.5%
0394 Decode String Go Medium O(n) O(n) 52.8%
0402 Remove K Digits Go Medium O(n) O(1) 28.7%
0456 132 Pattern Go Medium O(n) O(n) 30.7%
0496 Next Greater Element I Go Easy O(n) O(n) 65.8%
0503 Next Greater Element II Go Medium O(n) O(n) 58.6%
0636 Exclusive Time of Functions Go Medium O(n) O(n) 54.7%
0682 Baseball Game Go Easy O(n) O(n) 67.2%
0726 Number of Atoms Go Hard O(n) O(n) 51.0%
0735 Asteroid Collision Go Medium O(n) O(n) 43.3%
0739 Daily Temperatures Go Medium O(n) O(n) 64.7%
0844 Backspace String Compare Go Easy O(n) O(n) 47.1%
0856 Score of Parentheses Go Medium O(n) O(n) 64.9%
0880 Decoded String at Index Go Medium O(n) O(n) 28.2%
0895 Maximum Frequency Stack Go Hard O(n) O(n) 63.1%
0901 Online Stock Span Go Medium O(n) O(n) 61.4%
0907 Sum of Subarray Minimums Go Medium O(n) O(n) 33.1%
0921 Minimum Add to Make Parentheses Valid Go Medium O(n) O(n) 74.9%
0946 Validate Stack Sequences Go Medium O(n) O(n) 64.4%
1003 Check If Word Is Valid After Substitutions Go Medium O(n) O(1) 56.5%
1019 Next Greater Node In Linked List Go Medium O(n) O(1) 58.3%
1021 Remove Outermost Parentheses Go Easy O(n) O(1) 79.1%
1047 Remove All Adjacent Duplicates In String Go Easy O(n) O(1) 71.0%
1249 Minimum Remove to Make Valid Parentheses Go Medium 64.2%
1673 Find the Most Competitive Subsequence Go Medium 45.5%

Tree

No. Title Solution Difficulty Time Space Acceptance
0094 Binary Tree Inorder Traversal Go Medium O(n) O(1) 66.1%
0095 Unique Binary Search Trees II Go Medium 42.8%
0096 Unique Binary Search Trees Go Medium O(n^2) O(n) 54.6%
0098 Validate Binary Search Tree Go Medium O(n) O(1) 28.8%
0099 Recover Binary Search Tree Go Hard O(n) O(1) 42.6%
0100 Same Tree Go Easy O(n) O(1) 54.2%
0101 Symmetric Tree Go Easy O(n) O(1) 48.3%
0102 Binary Tree Level Order Traversal Go Medium O(n) O(1) 56.8%
0103 Binary Tree Zigzag Level Order Traversal Go Medium O(n) O(n) 50.3%
0104 Maximum Depth of Binary Tree Go Easy O(n) O(1) 68.2%
0105 Construct Binary Tree from Preorder and Inorder Traversal Go Medium 52.1%
0106 Construct Binary Tree from Inorder and Postorder Traversal Go Medium 49.9%
0107 Binary Tree Level Order Traversal II Go Medium O(n) O(1) 55.4%
0108 Convert Sorted Array to Binary Search Tree Go Easy O(n) O(1) 60.7%
0110 Balanced Binary Tree Go Easy O(n) O(1) 44.8%
0111 Minimum Depth of Binary Tree Go Easy O(n) O(1) 39.7%
0112 Path Sum Go Easy O(n) O(1) 42.5%
0113 Path Sum II Go Medium O(n) O(1) 49.3%
0114 Flatten Binary Tree to Linked List Go Medium O(n) O(1) 52.2%
0124 Binary Tree Maximum Path Sum Go Hard O(n) O(1) 35.6%
0129 Sum Root to Leaf Numbers Go Medium O(n) O(1) 51.1%
0144 Binary Tree Preorder Traversal Go Medium O(n) O(1) 57.7%
0145 Binary Tree Postorder Traversal Go Medium O(n) O(1) 57.8%
0173 Binary Search Tree Iterator Go Medium O(n) O(1) 60.4%
0199 Binary Tree Right Side View Go Medium O(n) O(1) 56.4%
0222 Count Complete Tree Nodes Go Medium O(n) O(1) 49.5%
0226 Invert Binary Tree Go Easy O(n) O(1) 67.2%
0230 Kth Smallest Element in a BST Go Medium O(n) O(1) 62.8%
0235 Lowest Common Ancestor of a Binary Search Tree Go Easy O(n) O(1) 52.0%
0236 Lowest Common Ancestor of a Binary Tree Go Medium O(n) O(1) 49.1%
0257 Binary Tree Paths Go Easy O(n) O(1) 53.8%
0337 House Robber III Go Medium 52.0%
0404 Sum of Left Leaves Go Easy O(n) O(1) 52.3%
0437 Path Sum III Go Medium O(n) O(1) 48.2%
0508 Most Frequent Subtree Sum Go Medium 59.2%
0513 Find Bottom Left Tree Value Go Medium 62.7%
0515 Find Largest Value in Each Tree Row Go Medium O(n) O(n) 62.3%
0538 Convert BST to Greater Tree Go Medium 59.6%
0563 Binary Tree Tilt Go Easy 53.1%
0572 Subtree of Another Tree Go Easy 44.5%
0623 Add One Row to Tree Go Medium 53.0%
0637 Average of Levels in Binary Tree Go Easy O(n) O(n) 66.0%
0653 Two Sum IV - Input is a BST Go Easy 56.3%
0662 Maximum Width of Binary Tree Go Medium 39.8%
0669 Trim a Binary Search Tree Go Medium 64.4%
0684 Redundant Connection Go Medium 59.0%
0685 Redundant Connection II Go Hard 33.0%
0834 Sum of Distances in Tree Go Hard 46.3%
0863 All Nodes Distance K in Binary Tree Go Medium 58.1%
0872 Leaf-Similar Trees Go Easy 64.5%
0897 Increasing Order Search Tree Go Easy 74.6%
0968 Binary Tree Cameras Go Hard 38.8%
0979 Distribute Coins in Binary Tree Go Medium 69.9%
0987 Vertical Order Traversal of a Binary Tree Go Hard 38.9%
0993 Cousins in Binary Tree Go Easy O(n) O(1) 52.3%
1026 Maximum Difference Between Node and Ancestor Go Medium 69.6%
1028 Recover a Tree From Preorder Traversal Go Hard 71.0%
1038 Binary Search Tree to Greater Sum Tree Go Medium 82.4%
1110 Delete Nodes And Return Forest Go Medium 67.8%
1123 Lowest Common Ancestor of Deepest Leaves Go Medium 68.0%
1145 Binary Tree Coloring Game Go Medium 51.3%
1302 Deepest Leaves Sum Go Medium 84.2%
1305 All Elements in Two Binary Search Trees Go Medium 77.8%

Dynamic programming

No. Title Solution Difficulty Time Space Acceptance
0005 Longest Palindromic Substring Go Medium 30.6%
0042 Trapping Rain Water Go Hard 51.4%
0053 Maximum Subarray Go Easy O(n) O(n) 47.8%
0062 Unique Paths Go Medium O(n^2) O(n^2) 56.2%
0063 Unique Paths II Go Medium O(n^2) O(n^2) 35.3%
0064 Minimum Path Sum Go Medium O(n^2) O(n^2) 56.4%
0070 Climbing Stairs Go Easy O(n) O(n) 48.7%
0091 Decode Ways Go Medium O(n) O(n) 26.8%
0095 Unique Binary Search Trees II Go Medium 42.8%
0096 Unique Binary Search Trees Go Medium O(n) O(n) 54.6%
0115 Distinct Subsequences Go Hard 39.9%
0120 Triangle Go Medium O(n^2) O(n) 45.9%
0121 Best Time to Buy and Sell Stock Go Easy O(n) O(1) 51.7%
0131 Palindrome Partitioning Go Medium 52.4%
0152 Maximum Product Subarray Go Medium O(n) O(1) 32.8%
0174 Dungeon Game Go Hard 33.4%
0198 House Robber Go Medium O(n) O(n) 43.0%
0213 House Robber II Go Medium O(n) O(n) 37.6%
0300 Longest Increasing Subsequence Go Medium O(n log n) O(n) 44.3%
0303 Range Sum Query - Immutable Go Easy 48.0%
0304 Range Sum Query 2D - Immutable Go Medium 40.8%
0309 Best Time to Buy and Sell Stock with Cooldown Go Medium O(n) O(n) 48.3%
0322 Coin Change Go Medium O(n) O(n) 37.6%
0337 House Robber III Go Medium 52.0%
0338 Counting Bits Go Medium O(n) O(n) 70.5%
0343 Integer Break Go Medium O(n^2) O(n) 51.3%
0354 Russian Doll Envelopes Go Hard 36.5%
0357 Count Numbers with Unique Digits Go Medium O(1) O(1) 48.9%
0376 Wiggle Subsequence Go Medium 42.2%
0392 Is Subsequence Go Easy O(n) O(1) 49.5%
0410 Split Array Largest Sum Go Hard 46.5%
0413 Arithmetic Slices Go Medium 60.0%
0416 Partition Equal Subset Sum Go Medium O(n^2) O(n) 44.9%
0474 Ones and Zeroes Go Medium 43.8%
0494 Target Sum Go Medium 45.7%
0638 Shopping Offers Go Medium 53.0%
0714 Best Time to Buy and Sell Stock with Transaction Fee Go Medium O(n) O(1) 58.0%
0718 Maximum Length of Repeated Subarray Go Medium 50.4%
0746 Min Cost Climbing Stairs Go Easy O(n) O(1) 50.9%
0838 Push Dominoes Go Medium O(n) O(n) 49.9%
0887 Super Egg Drop Go Hard 27.0%
0898 Bitwise ORs of Subarrays Go Medium 34.3%
0920 Number of Music Playlists Go Hard 47.8%
0968 Binary Tree Cameras Go Hard 38.8%
0978 Longest Turbulent Subarray Go Medium 46.6%
1025 Divisor Game Go Easy O(1) O(1) 66.1%
1049 Last Stone Weight II Go Medium 45.6%
1074 Number of Submatrices That Sum to Target Go Hard 61.9%
1105 Filling Bookcase Shelves Go Medium 57.5%
1235 Maximum Profit in Job Scheduling Go Hard 47.5%
1423 Maximum Points You Can Obtain from Cards Go Medium 46.8%
1463 Cherry Pickup II Go Hard 69.0%
1641 Count Sorted Vowel Strings Go Medium 76.1%
1654 Minimum Jumps to Reach Home Go Medium 25.4%
1655 Distribute Repeating Integers Go Hard 39.9%
1659 Maximize Grid Happiness Go Hard 35.6%
1664 Ways to Make a Fair Array Go Medium 62.1%
1690 Stone Game VII Go Medium 48.7%
1691 Maximum Height by Stacking Cuboids Go Hard 50.2%

Backtracking

  • 排列问题 Permutations。第 46 题,第 47 题。第 60 题,第 526 题,第 996 题。
  • 组合问题 Combination。第 39 题,第 40 题,第 77 题,第 216 题。
  • 排列和组合杂交问题。第 1079 题。
  • N 皇后终极解法(二进制解法)。第 51 题,第 52 题。
  • 数独问题。第 37 题。
  • 四个方向搜索。第 79 题,第 212 题,第 980 题。
  • 子集合问题。第 78 题,第 90 题。
  • Trie。第 208 题,第 211 题。
  • BFS 优化。第 126 题,第 127 题。
  • DFS 模板。(只是一个例子,不对应任何题)
func combinationSum2(candidates []int, target int) [][]int {
    if len(candidates) == 0 {
        return [][]int{}
    }
    c, res := []int{}, [][]int{}
    sort.Ints(candidates)
    findcombinationSum2(candidates, target, 0, c, &res)
    return res
}

func findcombinationSum2(nums []int, target, index int, c []int, res *[][]int) {
    if target == 0 {
        b := make([]int, len(c))
        copy(b, c)
        *res = append(*res, b)
        return
    }
    for i := index; i < len(nums); i++ {
        if i > index && nums[i] == nums[i-1] { // 这里是去重的关键逻辑
            continue
        }
        if target >= nums[i] {
            c = append(c, nums[i])
            findcombinationSum2(nums, target-nums[i], i+1, c, res)
            c = c[:len(c)-1]
        }
    }
}
  • BFS 模板。(只是一个例子,不对应任何题)
func updateMatrix_BFS(matrix [][]int) [][]int {
    res := make([][]int, len(matrix))
    if len(matrix) == 0 || len(matrix[0]) == 0 {
        return res
    }
    queue := make([][]int, 0)
    for i, _ := range matrix {
        res[i] = make([]int, len(matrix[0]))
        for j, _ := range res[i] {
            if matrix[i][j] == 0 {
                res[i][j] = -1
                queue = append(queue, []int{i, j})
            }
        }
    }
    level := 1
    for len(queue) > 0 {
        size := len(queue)
        for size > 0 {
            size -= 1
            node := queue[0]
            queue = queue[1:]
            i, j := node[0], node[1]
            for _, direction := range [][]int{{-1, 0}, {1, 0}, {0, 1}, {0, -1}} {
                x := i + direction[0]
                y := j + direction[1]
                if x < 0 || x >= len(matrix) || y < 0 || y >= len(matrix[0]) || res[x][y] < 0 || res[x][y] > 0 {
                    continue
                }
                res[x][y] = level
                queue = append(queue, []int{x, y})
            }
        }
        level++
    }
    for i, row := range res {
        for j, cell := range row {
            if cell == -1 {
                res[i][j] = 0
            }
        }
    }
    return res
}
No. Title Solution Difficulty Time Space Acceptance
0017 Letter Combinations of a Phone Number Go Medium O(log n) O(1) 49.4%
0022 Generate Parentheses Go Medium O(log n) O(1) 65.6%
0037 Sudoku Solver Go Hard O(n^2) O(n^2) 46.8%
0039 Combination Sum Go Medium O(n log n) O(n) 59.5%
0040 Combination Sum II Go Medium O(n log n) O(n) 50.3%
0046 Permutations Go Medium O(n) O(n) 66.9%
0047 Permutations II Go Medium O(n^2) O(n) 49.6%
0051 N-Queens Go Hard O(n!) O(n) 49.9%
0052 N-Queens II Go Hard O(n!) O(n) 60.4%
0060 Permutation Sequence Go Hard O(n log n) O(1) 39.5%
0077 Combinations Go Medium O(n) O(n) 57.8%
0078 Subsets Go Medium O(n^2) O(n) 65.4%
0079 Word Search Go Medium O(n^2) O(n^2) 37.0%
0089 Gray Code Go Medium O(n) O(1) 50.6%
0090 Subsets II Go Medium O(n^2) O(n) 49.0%
0093 Restore IP Addresses Go Medium O(n) O(n) 37.7%
0126 Word Ladder II Go Hard O(n) O(n^2) 23.9%
0131 Palindrome Partitioning Go Medium O(n) O(n^2) 52.4%
0211 Design Add and Search Words Data Structure Go Medium O(n) O(n) 40.4%
0212 Word Search II Go Hard O(n^2) O(n^2) 37.3%
0216 Combination Sum III Go Medium O(n) O(1) 60.5%
0306 Additive Number Go Medium O(n^2) O(1) 29.7%
0357 Count Numbers with Unique Digits Go Medium O(1) O(1) 48.9%
0401 Binary Watch Go Easy O(1) O(1) 48.5%
0526 Beautiful Arrangement Go Medium O(n^2) O(1) 62.0%
0784 Letter Case Permutation Go Medium O(n) O(n) 68.6%
0842 Split Array into Fibonacci Sequence Go Medium O(n^2) O(1) 37.0%
0980 Unique Paths III Go Hard O(n log n) O(n) 77.1%
0996 Number of Squareful Arrays Go Hard O(n log n) O(n) 48.6%
1079 Letter Tile Possibilities Go Medium O(n^2) O(1) 75.9%
1641 Count Sorted Vowel Strings Go Medium 76.1%
1655 Distribute Repeating Integers Go Hard 39.9%
1659 Maximize Grid Happiness Go Hard 35.6%
1681 Minimum Incompatibility Go Hard 35.7%
1688 Count of Matches in Tournament Go Easy 81.6%
No. Title Solution Difficulty Time Space Acceptance
0017 Letter Combinations of a Phone Number Go Medium 49.4%
0098 Validate Binary Search Tree Go Medium O(n) O(1) 28.8%
0099 Recover Binary Search Tree Go Hard O(n) O(1) 42.6%
0100 Same Tree Go Easy O(n) O(1) 54.2%
0101 Symmetric Tree Go Easy O(n) O(1) 48.3%
0104 Maximum Depth of Binary Tree Go Easy O(n) O(1) 68.2%
0105 Construct Binary Tree from Preorder and Inorder Traversal Go Medium 52.1%
0106 Construct Binary Tree from Inorder and Postorder Traversal Go Medium 49.9%
0108 Convert Sorted Array to Binary Search Tree Go Easy O(n) O(1) 60.7%
0109 Convert Sorted List to Binary Search Tree Go Medium O(log n) O(n) 50.4%
0110 Balanced Binary Tree Go Easy O(n) O(1) 44.8%
0111 Minimum Depth of Binary Tree Go Easy O(n) O(1) 39.7%
0112 Path Sum Go Easy O(n) O(1) 42.5%
0113 Path Sum II Go Medium O(n) O(1) 49.3%
0114 Flatten Binary Tree to Linked List Go Medium O(n) O(1) 52.2%
0124 Binary Tree Maximum Path Sum Go Hard O(n) O(1) 35.6%
0129 Sum Root to Leaf Numbers Go Medium O(n) O(1) 51.1%
0130 Surrounded Regions Go Medium 29.6%
0131 Palindrome Partitioning Go Medium 52.4%
0199 Binary Tree Right Side View Go Medium O(n) O(1) 56.4%
0200 Number of Islands Go Medium O(n^2) O(n^2) 49.3%
0207 Course Schedule Go Medium O(n^2) O(n^2) 44.3%
0210 Course Schedule II Go Medium O(n^2) O(n^2) 42.8%
0211 Design Add and Search Words Data Structure Go Medium 40.4%
0257 Binary Tree Paths Go Easy O(n) O(1) 53.8%
0329 Longest Increasing Path in a Matrix Go Hard 45.2%
0337 House Robber III Go Medium 52.0%
0394 Decode String Go Medium O(n) O(n) 52.8%
0491 Increasing Subsequences Go Medium 47.6%
0494 Target Sum Go Medium 45.7%
0513 Find Bottom Left Tree Value Go Medium 62.7%
0515 Find Largest Value in Each Tree Row Go Medium O(n) O(n) 62.3%
0526 Beautiful Arrangement Go Medium 62.0%
0529 Minesweeper Go Medium 61.3%
0538 Convert BST to Greater Tree Go Medium 59.6%
0542 01 Matrix Go Medium O(n) O(1) 41.0%
0547 Number of Provinces Go Medium 60.6%
0563 Binary Tree Tilt Go Easy 53.1%
0638 Shopping Offers Go Medium 53.0%
0685 Redundant Connection II Go Hard 33.0%
0695 Max Area of Island Go Medium 65.0%
0721 Accounts Merge Go Medium 52.1%
0733 Flood Fill Go Easy 55.9%
0753 Cracking the Safe Go Hard 52.4%
0756 Pyramid Transition Matrix Go Medium 55.6%
0778 Swim in Rising Water Go Hard 54.7%
0785 Is Graph Bipartite? Go Medium 48.7%
0802 Find Eventual Safe States Go Medium 49.9%
0834 Sum of Distances in Tree Go Hard 46.3%
0839 Similar String Groups Go Hard 41.2%
0841 Keys and Rooms Go Medium 66.4%
0851 Loud and Rich Go Medium 52.7%
0863 All Nodes Distance K in Binary Tree Go Medium 58.1%
0872 Leaf-Similar Trees Go Easy 64.5%
0897 Increasing Order Search Tree Go Easy 74.6%
0924 Minimize Malware Spread Go Hard 41.9%
0928 Minimize Malware Spread II Go Hard 41.5%
0947 Most Stones Removed with Same Row or Column Go Medium 55.5%
0959 Regions Cut By Slashes Go Medium 67.2%
0968 Binary Tree Cameras Go Hard 38.8%
0979 Distribute Coins in Binary Tree Go Medium 69.9%
0980 Unique Paths III Go Hard O(n log n) O(n) 77.1%
0987 Vertical Order Traversal of a Binary Tree Go Hard 38.9%
1020 Number of Enclaves Go Medium 59.1%
1026 Maximum Difference Between Node and Ancestor Go Medium 69.6%
1028 Recover a Tree From Preorder Traversal Go Hard 71.0%
1038 Binary Search Tree to Greater Sum Tree Go Medium 82.4%
1110 Delete Nodes And Return Forest Go Medium 67.8%
1123 Lowest Common Ancestor of Deepest Leaves Go Medium 68.0%
1145 Binary Tree Coloring Game Go Medium 51.3%
1203 Sort Items by Groups Respecting Dependencies Go Hard 48.3%
1254 Number of Closed Islands Go Medium 61.7%
1302 Deepest Leaves Sum Go Medium 84.2%
1306 Jump Game III Go Medium 62.3%
1319 Number of Operations to Make Network Connected Go Medium 55.5%
1631 Path With Minimum Effort Go Medium 49.9%
No. Title Solution Difficulty Time Space Acceptance
0101 Symmetric Tree Go Easy O(n) O(1) 48.3%
0102 Binary Tree Level Order Traversal Go Medium O(n) O(1) 56.8%
0103 Binary Tree Zigzag Level Order Traversal Go Medium O(n) O(n) 50.3%
0107 Binary Tree Level Order Traversal II Go Medium O(n) O(1) 55.4%
0111 Minimum Depth of Binary Tree Go Easy O(n) O(1) 39.7%
0126 Word Ladder II Go Hard O(n) O(n^2) 23.9%
0127 Word Ladder Go Hard O(n) O(n) 32.0%
0130 Surrounded Regions Go Medium 29.6%
0199 Binary Tree Right Side View Go Medium O(n) O(1) 56.4%
0200 Number of Islands Go Medium O(n^2) O(n^2) 49.3%
0207 Course Schedule Go Medium O(n^2) O(n^2) 44.3%
0210 Course Schedule II Go Medium O(n^2) O(n^2) 42.8%
0513 Find Bottom Left Tree Value Go Medium 62.7%
0515 Find Largest Value in Each Tree Row Go Medium O(n) O(n) 62.3%
0529 Minesweeper Go Medium 61.3%
0542 01 Matrix Go Medium O(n) O(1) 41.0%
0785 Is Graph Bipartite? Go Medium 48.7%
0815 Bus Routes Go Hard 43.4%
0863 All Nodes Distance K in Binary Tree Go Medium 58.1%
0864 Shortest Path to Get All Keys Go Hard 42.3%
0987 Vertical Order Traversal of a Binary Tree Go Hard 38.9%
0993 Cousins in Binary Tree Go Easy O(n) O(1) 52.3%
1091 Shortest Path in Binary Matrix Go Medium 40.1%
1306 Jump Game III Go Medium 62.3%
1319 Number of Operations to Make Network Connected Go Medium 55.5%
1654 Minimum Jumps to Reach Home Go Medium 25.4%
  • 二分搜索的经典写法。需要注意的三点:
    1. 循环退出条件,注意是 low <= high,而不是 low < high。
    2. mid 的取值,mid := low + (high-low)»1
    3. low 和 high 的更新。low = mid + 1,high = mid - 1。
func binarySearchMatrix(nums []int, target int) int {
    low, high := 0, len(nums)-1
    for low <= high {
        mid := low + (high-low)>>1
        if nums[mid] == target {
            return mid
        } else if nums[mid] > target {
            high = mid - 1
        } else {
            low = mid + 1
        }
    }
    return -1
}
  • 二分搜索的变种写法。有 4 个基本变种:
    1. 查找第一个与 target 相等的元素,时间复杂度 O(logn)
    2. 查找最后一个与 target 相等的元素,时间复杂度 O(logn)
    3. 查找第一个大于等于 target 的元素,时间复杂度 O(logn)
    4. 查找最后一个小于等于 target 的元素,时间复杂度 O(logn)
// 二分查找第一个与 target 相等的元素,时间复杂度 O(logn)
func searchFirstEqualElement(nums []int, target int) int {
    low, high := 0, len(nums)-1
    for low <= high {
        mid := low + ((high - low) >> 1)
        if nums[mid] > target {
            high = mid - 1
        } else if nums[mid] < target {
            low = mid + 1
        } else {
            if (mid == 0) || (nums[mid-1] != target) { // 找到第一个与 target 相等的元素
                return mid
            }
            high = mid - 1
        }
    }
    return -1
}

// 二分查找最后一个与 target 相等的元素,时间复杂度 O(logn)
func searchLastEqualElement(nums []int, target int) int {
    low, high := 0, len(nums)-1
    for low <= high {
        mid := low + ((high - low) >> 1)
        if nums[mid] > target {
            high = mid - 1
        } else if nums[mid] < target {
            low = mid + 1
        } else {
            if (mid == len(nums)-1) || (nums[mid+1] != target) { // 找到最后一个与 target 相等的元素
                return mid
            }
            low = mid + 1
        }
    }
    return -1
}

// 二分查找第一个大于等于 target 的元素,时间复杂度 O(logn)
func searchFirstGreaterElement(nums []int, target int) int {
    low, high := 0, len(nums)-1
    for low <= high {
        mid := low + ((high - low) >> 1)
        if nums[mid] >= target {
            if (mid == 0) || (nums[mid-1] < target) { // 找到第一个大于等于 target 的元素
                return mid
            }
            high = mid - 1
        } else {
            low = mid + 1
        }
    }
    return -1
}

// 二分查找最后一个小于等于 target 的元素,时间复杂度 O(logn)
func searchLastLessElement(nums []int, target int) int {
    low, high := 0, len(nums)-1
    for low <= high {
        mid := low + ((high - low) >> 1)
        if nums[mid] <= target {
            if (mid == len(nums)-1) || (nums[mid+1] > target) { // 找到最后一个小于等于 target 的元素
                return mid
            }
            low = mid + 1
        } else {
            high = mid - 1
        }
    }
    return -1
}
  • 在基本有序的数组中用二分搜索。经典解法可以解,变种写法也可以写,常见的题型,在山峰数组中找山峰,在旋转有序数组中找分界点。第 33 题,第 81 题,第 153 题,第 154 题,第 162 题,第 852 题
func peakIndexInMountainArray(A []int) int {
    low, high := 0, len(A)-1
    for low < high {
        mid := low + (high-low)>>1
        // 如果 mid 较大,则左侧存在峰值,high = m,如果 mid + 1 较大,则右侧存在峰值,low = mid + 1
        if A[mid] > A[mid+1] {
            high = mid
        } else {
            low = mid + 1
        }
    }
    return low
}
  • max-min 最大值最小化问题。求在最小满足条件的情况下的最大值。第 410 题,第 875 题,第 1011 题,第 1283 题。
No. Title Solution Difficulty Time Space Acceptance
0004 Median of Two Sorted Arrays Go Hard 31.2%
0029 Divide Two Integers Go Medium 16.9%
0033 Search in Rotated Sorted Array Go Medium 36.0%
0034 Find First and Last Position of Element in Sorted Array Go Medium 37.4%
0035 Search Insert Position Go Easy 42.8%
0050 Pow(x, n) Go Medium O(log n) O(1) 31.0%
0069 Sqrt(x) Go Easy O(log n) O(1) 35.2%
0074 Search a 2D Matrix Go Medium 38.0%
0081 Search in Rotated Sorted Array II Go Medium 33.6%
0153 Find Minimum in Rotated Sorted Array Go Medium 46.3%
0154 Find Minimum in Rotated Sorted Array II Go Hard 42.1%
0162 Find Peak Element Go Medium 44.0%
0167 Two Sum II - Input array is sorted Go Easy O(n) O(1) 55.8%
0174 Dungeon Game Go Hard 33.4%
0209 Minimum Size Subarray Sum Go Medium O(n) O(1) 39.7%
0222 Count Complete Tree Nodes Go Medium O(n) O(1) 49.5%
0230 Kth Smallest Element in a BST Go Medium O(n) O(1) 62.8%
0240 Search a 2D Matrix II Go Medium 45.2%
0275 H-Index II Go Medium 36.3%
0287 Find the Duplicate Number Go Medium O(n) O(1) 57.7%
0300 Longest Increasing Subsequence Go Medium O(n log n) O(n) 44.3%
0315 Count of Smaller Numbers After Self Go Hard 42.4%
0327 Count of Range Sum Go Hard 36.1%
0349 Intersection of Two Arrays Go Easy O(n) O(n) 65.0%
0350 Intersection of Two Arrays II Go Easy O(n) O(n) 52.0%
0354 Russian Doll Envelopes Go Hard 36.5%
0367 Valid Perfect Square Go Easy 42.1%
0378 Kth Smallest Element in a Sorted Matrix Go Medium 56.3%
0392 Is Subsequence Go Easy O(n) O(1) 49.5%
0410 Split Array Largest Sum Go Hard 46.5%
0436 Find Right Interval Go Medium 48.5%
0441 Arranging Coins Go Easy 42.4%
0454 4Sum II Go Medium O(n^2) O(n) 54.6%
0475 Heaters Go Medium 33.7%
0483 Smallest Good Base Go Hard 36.3%
0493 Reverse Pairs Go Hard 27.0%
0497 Random Point in Non-overlapping Rectangles Go Medium 39.1%
0528 Random Pick with Weight Go Medium 44.7%
0658 Find K Closest Elements Go Medium 42.1%
0668 Kth Smallest Number in Multiplication Table Go Hard 47.8%
0704 Binary Search Go Easy 54.1%
0710 Random Pick with Blacklist Go Hard O(n) O(n) 32.9%
0718 Maximum Length of Repeated Subarray Go Medium 50.4%
0719 Find K-th Smallest Pair Distance Go Hard 32.6%
0744 Find Smallest Letter Greater Than Target Go Easy 45.5%
0778 Swim in Rising Water Go Hard 54.7%
0786 K-th Smallest Prime Fraction Go Hard 43.0%
0793 Preimage Size of Factorial Zeroes Function Go Hard 40.6%
0852 Peak Index in a Mountain Array Go Easy 71.6%
0862 Shortest Subarray with Sum at Least K Go Hard 25.2%
0875 Koko Eating Bananas Go Medium 53.5%
0878 Nth Magical Number Go Hard 28.8%
0887 Super Egg Drop Go Hard 27.0%
0911 Online Election Go Medium 51.4%
0927 Three Equal Parts Go Hard 34.6%
0981 Time Based Key-Value Store Go Medium 54.2%
1011 Capacity To Ship Packages Within D Days Go Medium 59.8%
1111 Maximum Nesting Depth of Two Valid Parentheses Strings Go Medium 72.6%
1157 Online Majority Element In Subarray Go Hard 39.8%
1170 Compare Strings by Frequency of the Smallest Character Go Medium 60.1%
1201 Ugly Number III Go Medium 26.4%
1235 Maximum Profit in Job Scheduling Go Hard 47.5%
1283 Find the Smallest Divisor Given a Threshold Go Medium 49.7%
1300 Sum of Mutated Array Closest to Target Go Medium 43.0%
1337 The K Weakest Rows in a Matrix Go Easy 71.9%
1631 Path With Minimum Effort Go Medium 49.9%
1649 Create Sorted Array through Instructions Go Hard 36.4%
1658 Minimum Operations to Reduce X to Zero Go Medium 33.3%

Math

No. Title Solution Difficulty Time Space Acceptance
0002 Add Two Numbers Go Medium O(n) O(1) 35.6%
0007 Reverse Integer Go Easy 25.9%
0008 String to Integer (atoi) Go Medium 15.7%
0009 Palindrome Number Go Easy 49.9%
0012 Integer to Roman Go Medium 57.0%
0013 Roman to Integer Go Easy 56.9%
0029 Divide Two Integers Go Medium 16.9%
0043 Multiply Strings Go Medium 35.0%
0050 Pow(x, n) Go Medium O(log n) O(1) 31.0%
0060 Permutation Sequence Go Hard O(n log n) O(1) 39.5%
0067 Add Binary Go Easy 47.1%
0069 Sqrt(x) Go Easy O(log n) O(1) 35.2%
0168 Excel Sheet Column Title Go Easy 31.8%
0171 Excel Sheet Column Number Go Easy 57.0%
0172 Factorial Trailing Zeroes Go Easy 38.7%
0202 Happy Number Go Easy O(log n) O(1) 51.3%
0204 Count Primes Go Easy 32.3%
0223 Rectangle Area Go Medium 38.3%
0224 Basic Calculator Go Hard O(n) O(n) 38.2%
0231 Power of Two Go Easy O(1) O(1) 43.8%
0258 Add Digits Go Easy 58.6%
0263 Ugly Number Go Easy O(log n) O(1) 41.7%
0268 Missing Number Go Easy 55.1%
0326 Power of Three Go Easy O(1) O(1) 42.1%
0343 Integer Break Go Medium O(n^2) O(n) 51.3%
0357 Count Numbers with Unique Digits Go Medium O(1) O(1) 48.9%
0367 Valid Perfect Square Go Easy 42.1%
0372 Super Pow Go Medium 36.7%
0397 Integer Replacement Go Medium 33.5%
0413 Arithmetic Slices Go Medium 60.0%
0441 Arranging Coins Go Easy 42.4%
0447 Number of Boomerangs Go Medium 52.5%
0453 Minimum Moves to Equal Array Elements Go Easy 50.9%
0478 Generate Random Point in a Circle Go Medium 39.1%
0483 Smallest Good Base Go Hard 36.3%
0507 Perfect Number Go Easy 36.3%
0535 Encode and Decode TinyURL Go Medium 82.3%
0537 Complex Number Multiplication Go Medium 68.3%
0598 Range Addition II Go Easy 50.2%
0628 Maximum Product of Three Numbers Go Easy O(n) O(1) 46.8%
0633 Sum of Square Numbers Go Medium 32.6%
0645 Set Mismatch Go Easy 41.6%
0753 Cracking the Safe Go Hard 52.4%
0781 Rabbits in Forest Go Medium 55.6%
0812 Largest Triangle Area Go Easy 59.0%
0836 Rectangle Overlap Go Easy 44.0%
0869 Reordered Power of 2 Go Medium 61.1%
0878 Nth Magical Number Go Hard 28.8%
0885 Spiral Matrix III Go Medium O(n^2) O(1) 71.0%
0887 Super Egg Drop Go Hard 27.0%
0891 Sum of Subsequence Widths Go Hard O(n log n) O(1) 33.1%
0892 Surface Area of 3D Shapes Go Easy 59.9%
0910 Smallest Range II Go Medium 31.2%
0914 X of a Kind in a Deck of Cards Go Easy 34.1%
0927 Three Equal Parts Go Hard 34.6%
0942 DI String Match Go Easy O(n) O(1) 73.6%
0949 Largest Time for Given Digits Go Medium 36.2%
0952 Largest Component Size by Common Factor Go Hard 36.2%
0970 Powerful Integers Go Medium 40.0%
0976 Largest Perimeter Triangle Go Easy O(n log n) O(log n) 58.7%
0991 Broken Calculator Go Medium 49.8%
0996 Number of Squareful Arrays Go Hard O(n log n) O(n) 48.6%
1017 Convert to Base -2 Go Medium 59.2%
1025 Divisor Game Go Easy O(1) O(1) 66.1%
1037 Valid Boomerang Go Easy 37.7%
1073 Adding Two Negabinary Numbers Go Medium 34.8%
1093 Statistics from a Large Sample Go Medium 49.1%
1154 Day of the Year Go Easy 49.2%
1175 Prime Arrangements Go Easy 51.7%
1201 Ugly Number III Go Medium 26.4%
1217 Minimum Cost to Move Chips to The Same Position Go Easy 71.1%
1232 Check If It Is a Straight Line Go Easy 43.4%
1281 Subtract the Product and Sum of Digits of an Integer Go Easy 85.6%
1317 Convert Integer to the Sum of Two No-Zero Integers Go Easy 56.8%
1512 Number of Good Pairs Go Easy 87.7%
1641 Count Sorted Vowel Strings Go Medium 76.1%
1648 Sell Diminishing-Valued Colored Balls Go Medium 30.5%
1680 Concatenation of Consecutive Binary Numbers Go Medium 52.3%
1685 Sum of Absolute Differences in a Sorted Array Go Medium 62.8%
1716 Calculate Money in Leetcode Bank Go Easy 66.2%
Title Solution Difficulty Time Space
Closest Binary Search Tree Value Go Easy O(logn) O(1)
Closest Binary Search Tree Value II Go Hard O(n) O(n)
Search in Rotated Sorted Array Go Hard O(logn) O(1)
Search in Rotated Sorted Array II Go Medium O(logn) O(1)
Find Minimum in Rotated Sorted Array Go Medium O(logn) O(1)
Find Minimum in Rotated Sorted Array II Go Hard O(logn) O(1)
Search a 2D Matrix Go Medium O(log(m + n)) O(1)
Search a 2D Matrix II Go Medium O(m + n) O(1)
Search for a Range Go Medium O(logn) O(1)
Search Insert Position Go Medium O(logn) O(1)
Find Peak Element Go Medium O(logn) O(1)
Sqrt(x) Go Medium O(logn) O(1)
Median of Two Sorted Arrays Go Hard O(log(m + n)) O(1)

Hash Table

No. Title Solution Difficulty Time Space Acceptance
0001 Two Sum Go Easy O(n) O(n) 46.6%
0003 Longest Substring Without Repeating Characters Go Medium O(n) O(1) 31.5%
0018 4Sum Go Medium O(n^3) O(n^2) 35.0%
0030 Substring with Concatenation of All Words Go Hard O(n) O(n) 26.3%
0036 Valid Sudoku Go Medium O(n^2) O(n^2) 50.7%
0037 Sudoku Solver Go Hard O(n^2) O(n^2) 46.8%
0049 Group Anagrams Go Medium O(n log n) O(n) 59.5%
0076 Minimum Window Substring Go Hard O(n) O(n) 36.1%
0094 Binary Tree Inorder Traversal Go Medium O(n) O(1) 66.1%
0136 Single Number Go Easy 66.6%
0138 Copy List with Random Pointer Go Medium O(n) O(1) 41.2%
0187 Repeated DNA Sequences Go Medium 41.6%
0202 Happy Number Go Easy O(log n) O(1) 51.3%
0204 Count Primes Go Easy 32.3%
0205 Isomorphic Strings Go Easy O(log n) O(n) 40.5%
0217 Contains Duplicate Go Easy O(n) O(n) 56.7%
0219 Contains Duplicate II Go Easy O(n) O(n) 38.7%
0242 Valid Anagram Go Easy O(n) O(n) 58.7%
0274 H-Index Go Medium O(n) O(n) 36.4%
0290 Word Pattern Go Easy O(n) O(n) 38.4%
0347 Top K Frequent Elements Go Medium O(n) O(n) 62.5%
0349 Intersection of Two Arrays Go Easy O(n) O(n) 65.0%
0350 Intersection of Two Arrays II Go Easy O(n) O(n) 52.0%
0387 First Unique Character in a String Go Easy 53.8%
0389 Find the Difference Go Easy 57.9%
0409 Longest Palindrome Go Easy 52.2%
0438 Find All Anagrams in a String Go Medium O(n) O(1) 45.1%
0447 Number of Boomerangs Go Medium O(n) O(1) 52.5%
0451 Sort Characters By Frequency Go Medium O(n log n) O(1) 64.5%
0454 4Sum II Go Medium O(n^2) O(n) 54.6%
0463 Island Perimeter Go Easy 66.7%
0500 Keyboard Row Go Easy 65.8%
0508 Most Frequent Subtree Sum Go Medium 59.2%
0535 Encode and Decode TinyURL Go Medium 82.3%
0575 Distribute Candies Go Easy 64.5%
0594 Longest Harmonious Subsequence Go Easy 51.2%
0599 Minimum Index Sum of Two Lists Go Easy 51.8%
0632 Smallest Range Covering Elements from K Lists Go Hard 54.4%
0645 Set Mismatch Go Easy 41.6%
0648 Replace Words Go Medium O(n) O(n) 58.8%
0676 Implement Magic Dictionary Go Medium O(n) O(n) 55.3%
0705 Design HashSet Go Easy 64.6%
0706 Design HashMap Go Easy 64.2%
0710 Random Pick with Blacklist Go Hard O(n) O(n) 32.9%
0718 Maximum Length of Repeated Subarray Go Medium 50.4%
0720 Longest Word in Dictionary Go Easy O(n) O(n) 49.3%
0726 Number of Atoms Go Hard O(n) O(n) 51.0%
0739 Daily Temperatures Go Medium O(n) O(n) 64.7%
0748 Shortest Completing Word Go Easy 57.6%
0771 Jewels and Stones Go Easy 87.0%
0781 Rabbits in Forest Go Medium 55.6%
0811 Subdomain Visit Count Go Easy 71.6%
0884 Uncommon Words from Two Sentences Go Easy 64.2%
0895 Maximum Frequency Stack Go Hard O(n) O(n) 63.2%
0930 Binary Subarrays With Sum Go Medium O(n) O(n) 44.7%
0953 Verifying an Alien Dictionary Go Easy 51.9%
0961 N-Repeated Element in Size 2N Array Go Easy 74.6%
0966 Vowel Spellchecker Go Medium 50.3%
0970 Powerful Integers Go Medium 40.0%
0981 Time Based Key-Value Store Go Medium 54.2%
0987 Vertical Order Traversal of a Binary Tree Go Hard 38.9%
0992 Subarrays with K Different Integers Go Hard O(n) O(n) 50.8%
1002 Find Common Characters Go Easy 68.7%
1078 Occurrences After Bigram Go Easy 65.0%
1160 Find Words That Can Be Formed by Characters Go Easy 67.9%
1178 Number of Valid Words for Each Puzzle Go Hard 39.5%
1189 Maximum Number of Balloons Go Easy 62.1%
1207 Unique Number of Occurrences Go Easy 71.8%
1512 Number of Good Pairs Go Easy 87.7%
1539 Kth Missing Positive Number Go Easy 54.9%
1640 Check Array Formation Through Concatenation Go Easy 59.8%
1679 Max Number of K-Sum Pairs Go Medium 53.9%
1748 Sum of Unique Elements Go Easy 75.1%

Sort (已全部做完)

  • 深刻的理解多路快排。第 75 题。
  • 链表的排序,插入排序(第 147 题)和归并排序(第 148 题)
  • 桶排序和基数排序。第 164 题。
  • “摆动排序”。第 324 题。
  • 两两不相邻的排序。第 767 题,第 1054 题。
  • “饼子排序”。第 969 题。
No. Title Solution Difficulty Time Space Acceptance
0056 Merge Intervals Go Medium O(n log n) O(log n) 41.2%
0057 Insert Interval Go Medium O(n) O(1) 35.2%
0075 Sort Colors Go Medium O(n) O(1) 49.6%
0147 Insertion Sort List Go Medium O(n^2) O(1) 44.5%
0148 Sort List Go Medium O(n log n) O(log n) 46.5%
0164 Maximum Gap Go Hard O(n log n) O(log n) 37.0%
0179 Largest Number Go Medium O(n log n) O(log n) 30.8%
0220 Contains Duplicate III Go Medium O(n log n) O(1) 21.3%
0242 Valid Anagram Go Easy O(n) O(n) 58.7%
0274 H-Index Go Medium O(n) O(n) 36.4%
0315 Count of Smaller Numbers After Self Go Hard 42.4%
0324 Wiggle Sort II Go Medium O(n) O(n) 30.8%
0327 Count of Range Sum Go Hard 36.1%
0349 Intersection of Two Arrays Go Easy O(n) O(n) 65.0%
0350 Intersection of Two Arrays II Go Easy O(n) O(n) 52.0%
0493 Reverse Pairs Go Hard 27.0%
0524 Longest Word in Dictionary through Deleting Go Medium O(n) O(1) 50.1%
0710 Random Pick with Blacklist Go Hard O(n) O(n) 32.9%
0767 Reorganize String Go Medium O(n log n) O(log n) 50.2%
0853 Car Fleet Go Medium O(n log n) O(log n) 44.2%
0922 Sort Array By Parity II Go Easy O(n) O(1) 70.6%
0969 Pancake Sorting Go Medium O(n log n) O(log n) 68.7%
0973 K Closest Points to Origin Go Medium O(n log n) O(log n) 64.6%
0976 Largest Perimeter Triangle Go Easy O(n log n) O(log n) 58.7%
1030 Matrix Cells in Distance Order Go Easy O(n^2) O(1) 67.2%
1054 Distant Barcodes Go Medium O(n log n) O(log n) 44.2%
1122 Relative Sort Array Go Easy 68.1%
1235 Maximum Profit in Job Scheduling Go Hard 47.5%
1305 All Elements in Two Binary Search Trees Go Medium 77.8%
1329 Sort the Matrix Diagonally Go Medium 81.7%
1636 Sort Array by Increasing Frequency Go Easy 66.8%
1640 Check Array Formation Through Concatenation Go Easy 59.8%
1647 Minimum Deletions to Make Character Frequencies Unique Go Medium 54.8%
1648 Sell Diminishing-Valued Colored Balls Go Medium 30.5%
1691 Maximum Height by Stacking Cuboids Go Hard 50.2%
1710 Maximum Units on a Truck Go Easy 70.0%

Bit Manipulation

  • 异或的特性。第 136 题,第 268 题,第 389 题,第 421 题,
x ^ 0 = x
x ^ 11111……1111 = ~x
x ^ (~x) = 11111……1111
x ^ x = 0
a ^ b = c  => a ^ c = b  => b ^ c = a (交换律)
a ^ b ^ c = a ^ (b ^ c) = (a ^ b)^ c (结合律)
  • 构造特殊 Mask,将特殊位置放 0 或 1。
将 x 最右边的 n 位清零, x & ( ~0 << n )
获取 x 的第 n 位值(0 或者 1)(x >> n) & 1
获取 x 的第 n 位的幂值,x & (1 << (n - 1))
仅将第 n 位置为 1,x | (1 << n)
仅将第 n 位置为 0,x & (~(1 << n))
将 x 最高位至第 n 位()清零,x & ((1 << n) - 1)
将第 n 位至第 0()清零,x & (~((1 << (n + 1)) - 1)
  • 有特殊意义的 & 位操作运算。第 260 题,第 201 题,第 318 题,第 371 题,第 397 题,第 461 题,第 693 题,
X & 1 == 1 判断是否是奇数(偶数)
X & = (X - 1) 将最低位(LSB)1 清零
X & -X 得到最低位(LSB)1
X & ~X = 0
No. Title Solution Difficulty Time Space Acceptance
0078 Subsets Go Medium O(n^2) O(n) 65.4%
0136 Single Number Go Easy O(n) O(1) 66.6%
0137 Single Number II Go Medium O(n) O(1) 54.0%
0169 Majority Element Go Easy O(n) O(1) 60.2%
0187 Repeated DNA Sequences Go Medium O(n) O(1) 41.6%
0190 Reverse Bits Go Easy O(n) O(1) 42.4%
0191 Number of 1 Bits Go Easy O(n) O(1) 54.1%
0201 Bitwise AND of Numbers Range Go Medium O(n) O(1) 39.7%
0231 Power of Two Go Easy O(1) O(1) 43.8%
0260 Single Number III Go Medium O(n) O(1) 65.4%
0268 Missing Number Go Easy O(n) O(1) 55.1%
0318 Maximum Product of Word Lengths Go Medium O(n) O(1) 52.4%
0338 Counting Bits Go Medium O(n) O(n) 70.5%
0342 Power of Four Go Easy O(n) O(1) 41.8%
0371 Sum of Two Integers Go Medium O(n) O(1) 50.6%
0389 Find the Difference Go Easy O(n) O(1) 57.9%
0393 UTF-8 Validation Go Medium O(n) O(1) 38.1%
0397 Integer Replacement Go Medium O(n) O(1) 33.5%
0401 Binary Watch Go Easy O(1) O(1) 48.5%
0405 Convert a Number to Hexadecimal Go Easy O(n) O(1) 44.5%
0421 Maximum XOR of Two Numbers in an Array Go Medium O(n) O(1) 54.2%
0461 Hamming Distance Go Easy O(n) O(1) 73.2%
0476 Number Complement Go Easy O(n) O(1) 65.1%
0477 Total Hamming Distance Go Medium O(n) O(1) 50.6%
0693 Binary Number with Alternating Bits Go Easy O(n) O(1) 59.9%
0756 Pyramid Transition Matrix Go Medium O(n log n) O(n) 55.6%
0762 Prime Number of Set Bits in Binary Representation Go Easy O(n) O(1) 64.4%
0784 Letter Case Permutation Go Medium O(n) O(1) 68.6%
0898 Bitwise ORs of Subarrays Go Medium O(n) O(1) 34.3%
1178 Number of Valid Words for Each Puzzle Go Hard 39.5%
1290 Convert Binary Number in a Linked List to Integer Go Easy 81.8%
1461 Check If a String Contains All Binary Codes of Size K Go Medium 54.3%
1720 Decode XORed Array Go Easy 85.2%

Union Find

  • 灵活使用并查集的思想,熟练掌握并查集的 模板,模板中有两种并查集的实现方式,一种是路径压缩 + 秩优化的版本,另外一种是计算每个集合中元素的个数 + 最大集合元素个数的版本,这两种版本都有各自使用的地方。能使用第一类并查集模板的题目有:第 128 题,第 130 题,第 547 题,第 684 题,第 721 题,第 765 题,第 778 题,第 839 题,第 924 题,第 928 题,第 947 题,第 952 题,第 959 题,第 990 题。能使用第二类并查集模板的题目有:第 803 题,第 952 题。第 803 题秩优化和统计集合个数这些地方会卡时间,如果不优化,会 TLE。
  • 并查集是一种思想,有些题需要灵活使用这种思想,而不是死套模板,如第 399 题,这一题是 stringUnionFind,利用并查集思想实现的。这里每个节点是基于字符串和 map 的,而不是单纯的用 int 节点编号实现的。
  • 有些题死套模板反而做不出来,比如第 685 题,这一题不能路径压缩和秩优化,因为题目中涉及到有向图,需要知道节点的前驱节点,如果路径压缩了,这一题就没法做了。这一题不需要路径压缩和秩优化。
  • 灵活的抽象题目给的信息,将给定的信息合理的编号,使用并查集解题,并用 map 降低时间复杂度,如第 721 题,第 959 题。
  • 关于地图,砖块,网格的题目,可以新建一个特殊节点,将四周边缘的砖块或者网格都 union() 到这个特殊节点上。第 130 题,第 803 题。
  • 能用并查集的题目,一般也可以用 DFS 和 BFS 解答,只不过时间复杂度会高一点。
No. Title Solution Difficulty Time Space Acceptance
0128 Longest Consecutive Sequence Go Hard O(n) O(n) 46.4%
0130 Surrounded Regions Go Medium O(m*n) O(m*n) 29.6%
0200 Number of Islands Go Medium O(m*n) O(m*n) 49.3%
0399 Evaluate Division Go Medium O(n) O(n) 54.5%
0547 Number of Provinces Go Medium O(n^2) O(n) 60.6%
0684 Redundant Connection Go Medium O(n) O(n) 59.0%
0685 Redundant Connection II Go Hard O(n) O(n) 33.0%
0721 Accounts Merge Go Medium O(n) O(n) 52.1%
0765 Couples Holding Hands Go Hard O(n) O(n) 55.5%
0778 Swim in Rising Water Go Hard O(n^2) O(n) 54.7%
0803 Bricks Falling When Hit Go Hard O(n^2) O(n) 31.5%
0839 Similar String Groups Go Hard O(n^2) O(n) 41.2%
0924 Minimize Malware Spread Go Hard O(m*n) O(n) 41.9%
0928 Minimize Malware Spread II Go Hard O(m*n) O(n) 41.5%
0947 Most Stones Removed with Same Row or Column Go Medium O(n) O(n) 55.5%
0952 Largest Component Size by Common Factor Go Hard O(n) O(n) 36.2%
0959 Regions Cut By Slashes Go Medium O(n^2) O(n^2) 67.2%
0990 Satisfiability of Equality Equations Go Medium O(n) O(n) 46.9%
1202 Smallest String With Swaps Go Medium 48.9%
1319 Number of Operations to Make Network Connected Go Medium 55.5%
1579 Remove Max Number of Edges to Keep Graph Fully Traversable Go Hard 46.2%
1631 Path With Minimum Effort Go Medium 49.9%

Sliding Window

  • 双指针滑动窗口的经典写法。右指针不断往右移,移动到不能往右移动为止(具体条件根据题目而定)。当右指针到最右边以后,开始挪动左指针,释放窗口左边界。第 3 题,第 76 题,第 209 题,第 424 题,第 438 题,第 567 题,第 713 题,第 763 题,第 845 题,第 881 题,第 904 题,第 978 题,第 992 题,第 1004 题,第 1040 题,第 1052 题。
    left, right := 0, -1

    for left < len(s) {
        if right+1 < len(s) && freq[s[right+1]-'a'] == 0 {
            freq[s[right+1]-'a']++
            right++
        } else {
            freq[s[left]-'a']--
            left++
        }
        result = max(result, right-left+1)
    }
  • 滑动窗口经典题。第 239 题,第 480 题。
No. Title Solution Difficulty Time Space Acceptance
0003 Longest Substring Without Repeating Characters Go Medium O(n) O(1) 31.5%
0076 Minimum Window Substring Go Hard O(n) O(n) 36.1%
0239 Sliding Window Maximum Go Hard O(n * k) O(n) 44.7%
0395 Longest Substring with At Least K Repeating Characters Go Medium 43.6%
0424 Longest Repeating Character Replacement Go Medium O(n) O(1) 48.3%
0480 Sliding Window Median Go Hard O(n * log k) O(k) 38.8%
0567 Permutation in String Go Medium O(n) O(1) 44.6%
0978 Longest Turbulent Subarray Go Medium O(n) O(1) 46.6%
0992 Subarrays with K Different Integers Go Hard O(n) O(n) 50.8%
0995 Minimum Number of K Consecutive Bit Flips Go Hard O(n) O(1) 50.0%
1004 Max Consecutive Ones III Go Medium O(n) O(1) 60.9%
1040 Moving Stones Until Consecutive II Go Medium O(n log n) O(1) 54.1%
1052 Grumpy Bookstore Owner Go Medium O(n log n) O(1) 55.8%
1074 Number of Submatrices That Sum to Target Go Hard O(n^3) O(n) 61.9%
1208 Get Equal Substrings Within Budget Go Medium 44.1%
1423 Maximum Points You Can Obtain from Cards Go Medium 46.8%
1438 Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit Go Medium 44.4%
1658 Minimum Operations to Reduce X to Zero Go Medium 33.3%

Segment Tree

  • 线段树的经典数组实现写法。将合并两个节点 pushUp 逻辑抽象出来了,可以实现任意操作(常见的操作有:加法,取 max,min 等等)。第 218 题,第 303 题,第 307 题,第 699 题。
  • 计数线段树的经典写法。第 315 题,第 327 题,第 493 题。
  • 线段树的树的实现写法。第 715 题,第 732 题。
  • 区间懒惰更新。第 218 题,第 699 题。
  • 离散化。离散化需要注意一个特殊情况:假如三个区间为 [1,10] [1,4] [6,10],离散化后 x[1]=1,x[2]=4,x[3]=6,x[4]=10。第一个区间为 [1,4],第二个区间为 [1,2],第三个区间为 [3,4],这样一来,区间一 = 区间二 + 区间三,这和离散前的模型不符,离散前,很明显,区间一 > 区间二 + 区间三。正确的做法是:在相差大于 1 的数间加一个数,例如在上面 1 4 6 10 中间加 5,即可 x[1]=1,x[2]=4,x[3]=5,x[4]=6,x[5]=10。这样处理之后,区间一是 1-5 ,区间二是 1-2 ,区间三是 4-5 。
  • 灵活构建线段树。线段树节点可以存储多条信息,合并两个节点的 pushUp 操作也可以是多样的。第 850 题,第 1157 题。

线段树 题型从简单到困难:

  1. 单点更新:
    HDU 1166 敌兵布阵 update:单点增减 query:区间求和
    HDU 1754 I Hate It update:单点替换 query:区间最值
    HDU 1394 Minimum Inversion Number update:单点增减 query:区间求和
    HDU 2795 Billboard query:区间求最大值的位子(直接把update的操作在query里做了)
  2. 区间更新:
    HDU 1698 Just a Hook update:成段替换 (由于只query一次总区间,所以可以直接输出 1 结点的信息)
    POJ 3468 A Simple Problem with Integers update:成段增减 query:区间求和
    POJ 2528 Mayor’s posters 离散化 + update:成段替换 query:简单hash
    POJ 3225 Help with Intervals update:成段替换,区间异或 query:简单hash
  3. 区间合并(这类题目会询问区间中满足条件的连续最长区间,所以PushUp的时候需要对左右儿子的区间进行合并):
    POJ 3667 Hotel update:区间替换 query:询问满足条件的最左端点
  4. 扫描线(这类题目需要将一些操作排序,然后从左到右用一根扫描线扫过去最典型的就是矩形面积并,周长并等题):
    HDU 1542 Atlantis update:区间增减 query:直接取根节点的值
    HDU 1828 Picture update:区间增减 query:直接取根节点的值
No. Title Solution Difficulty Time Space Acceptance
0218 The Skyline Problem Go Hard O(n log n) O(n) 36.5%
0307 Range Sum Query - Mutable Go Medium O(1) O(n) 36.8%
0315 Count of Smaller Numbers After Self Go Hard O(n log n) O(n) 42.4%
0327 Count of Range Sum Go Hard O(n log n) O(n) 36.1%
0493 Reverse Pairs Go Hard O(n log n) O(n) 27.0%
0699 Falling Squares Go Hard O(n log n) O(n) 42.7%
0715 Range Module Go Hard O(log n) O(n) 40.4%
0732 My Calendar III Go Hard O(log n) O(n) 62.1%
0850 Rectangle Area II Go Hard O(n log n) O(n) 48.4%
1157 Online Majority Element In Subarray Go Hard O(log n) O(n) 39.8%
1649 Create Sorted Array through Instructions Go Hard 36.4%

Binary Indexed Tree

No. Title Solution Difficulty Time Space Acceptance
0218 The Skyline Problem Go Hard 36.5%
0307 Range Sum Query - Mutable Go Medium 36.8%
0315 Count of Smaller Numbers After Self Go Hard 42.4%
0327 Count of Range Sum Go Hard 36.1%
0493 Reverse Pairs Go Hard 27.0%
1649 Create Sorted Array through Instructions Go Hard 36.4%

3、大公司算法题

Google

Title Solution Difficulty Frequency
Plus One Go Easy ★★★★★★
Number of Islands Go Medium ★★★★
Summary Ranges Go Medium ★★★★
Perfect Squares Go Medium ★★★★
Merge Intervals Go Hard ★★★
Valid Parentheses Go Easy ★★★
Trapping Rain Water Go Hard ★★
Merge k Sorted Lists Go Hard ★★
Longest Consecutive Sequence Go Hard ★★
Find Peak Element Go Medium ★★
Power of Two Go Easy ★★
Spiral Matrix Go Medium ★★
Sliding Window Maximum Go Hard ★★
Pow(x, n) Go Medium ★★
Letter Combinations of a Phone Number Go Medium ★★
Heaters Go Easy

Facebook

Title Solution Difficulty Frequency
3Sum Go Medium ★★★★★★
Valid Palindrome Go Easy ★★★★★★
Valid Palindrome II Go Easy ★★★★★★
Move Zeroes Go Easy ★★★★★★
Remove Invalid Parentheses Go Hard ★★★★★★
Add Binary Go Easy ★★★★★
Two Sum Go Easy ★★★★★
Bnary Tree Paths Go Easy ★★★★
Letter Combinations of a Phone Number Go Medium ★★★★
Merge k Sorted Lists Go Hard ★★★★
Reverse Linked List Go Easy ★★★
Merge Intervals Go Hard ★★★
Number of Islands Go Medium ★★★
Reverse Linked List Go Easy ★★★
Expression Add Operators Go Hard ★★★
Subsets Go Medium ★★★
Sort Colors Go Medium ★★

Snapchat

Title Solution Difficulty Frequency
Game of Life Go Medium ★★★★★★
Meeting Rooms II Go Medium ★★★★★★
Valid Sudoku Go Easy ★★★★★
Binary Tree Vertical Order Traversal Go Medium ★★★★
Alien Dictionary Go Hard ★★★★
One Edit Distance Go Medium ★★★
Sudoku Solver Go Hard ★★★
Reverse Linked List Go Easy ★★
Unique Binary Search Trees Go Medium ★★
Minimum Window Substring Go Hard ★★
Remove K Digits Go Medium
Ternary Expression Parser Go Medium

Uber

Title Solution Difficulty Frequency
Valid Sudoku Go Easy ★★★★
Spiral Matrix Go Medium ★★★★
Letter Combinations of a Phone Number Go Medium ★★★★
Group Anagrams Go Medium ★★★★
Word Pattern Go Easy ★★★
Roman to Integer Go Easy ★★★
Combination Sum Go Medium ★★

Airbnb

Title Solution Difficulty Frequency
Two Sum Go Easy ★★★★★
Text Justification Go Hard ★★★★
House Robber Go Easy ★★
Single Number Go Medium ★★
Word Search II Go Hard ★★
Add Two Numbers Go Medium ★★

LinkedIn

Title Solution Difficulty Frequency
Maximum Subarray Go Medium ★★★★★★
Pow(x, n) Go Medium ★★★★★★
Merge Intervals Go Hard ★★★★★★
Isomorphic Strings Go Easy ★★★★★★
Search in Rotated Sorted Array Go Hard ★★★★★
Search for a Range Go Medium ★★★★★
Two Sum Go Easy ★★★★
Binary Tree Level Order Traversal Go Easy ★★★★
Evaluate Reverse Polish Notation Go Medium ★★★
Maximum Product Subarray Go Medium ★★★
Product of Array Except Self Go Medium ★★★
Symmetric Tree Go Easy ★★

Amazon

Title Solution Difficulty Frequency
Two Sum Go Easy ★★★★★★
Min Cost Climbing Stairs Go Easy ★★★★
Number of Islands Go Medium ★★
Add Two Numbers Go Medium ★★
Reverse Linked List Go Easy ★★
Valid Parentheses Go Easy ★★
Longest Palindromic Substring Go Medium ★★
Trapping Rain Water Go Hard ★★
Longest Substring Without Repeating Characters Go Medium ★★
Letter Combinations of a Phone Number Go Medium ★★
Valid Anagram Go Easy ★★
Rotate Image Go Medium ★★
Best Time to Buy and Sell Stock Go Easy ★★
3Sum Go Medium ★★
Sliding Window Maximum Go Hard ★★

Microsoft

Title Solution Difficulty Frequency
Reverse Linked List Go Easy ★★★★★★
Two Sum Go Easy ★★★★★
String to Integer (atoi) Go Easy ★★★★
Add Two Numbers Go Medium ★★★★
Excel Sheet Column Number Go Easy ★★★★
Validate Binary Search Tree Go Medium ★★★
Merge Two Sorted Lists Go Easy ★★★

   转载规则


《leetcode列表分类》 bill 采用 知识共享署名 4.0 国际许可协议 进行许可。
 上一篇
windows上必装的软件 windows上必装的软件
软件 Maczip:压缩软件 Typora:md文档软件 V2rayU:翻墙软件 VSCode:编辑器 Beyond Compare 4:文件对比工具 Postman:接口测试工具 Wireshark:抓包工具 Xshell
2020-03-11
下一篇 
数据结构和算法 数据结构和算法
目录 复杂度分析 数组 复杂度分析 复杂度分析 复杂度分析 复杂度分析 复杂度分析 复杂度分析 复杂度分析 复杂度分析 复杂度分析 复杂度分析
2020-03-10
  目录