Author: github.com/lzl124631x
My C++ Code for LeetCode OJ.
Please give this repo a ⭐ if it inspires you. Thanks. 😊
😩 Hate manually copy & pasting the example testcases when solving LeetCode problems?
👉 Try my LeetCode Testcase Extractor
Now I'm using a Chrome Extension I developed -- LeetCoder -- to facilitate my having fun on LeetCode. Features including but not limited to:
- showing stats
- copying problem, answer and testcases
- randomly picking a problem.
# | Title | Difficulty | Solution |
---|---|---|---|
1 | Two Sum | Easy | Solution |
2 | Add Two Numbers | Medium | Solution |
3 | Longest Substring Without Repeating Characters | Medium | Solution |
4 | Median of Two Sorted Arrays | Hard | Solution |
5 | Longest Palindromic Substring | Medium | Solution |
6 | ZigZag Conversion | Medium | Solution |
7 | Reverse Integer | Easy | Solution |
8 | String to Integer (atoi) | Medium | Solution |
9 | Palindrome Number | Easy | Solution |
10 | Regular Expression Matching | Hard | Solution |
11 | Container With Most Water | Medium | Solution |
12 | Integer to Roman | Solution | |
13 | Roman to Integer | Solution | |
14 | Longest Common Prefix | Solution | |
15 | 3Sum | Medium | Solution |
16 | 3Sum Closest | Medium | Solution |
17 | Letter Combinations of a Phone Number | Medium | Solution |
18 | 4Sum | Medium | Solution |
19 | Remove Nth Node From End of List | Solution | |
20 | Valid Parentheses | Easy | Solution |
21 | Merge Two Sorted Lists | Easy | Solution |
22 | Generate Parentheses | Medium | Solution |
23 | Merge k Sorted Lists | Hard | Solution |
24 | Swap Nodes in Pairs | Medium | Solution |
25 | Reverse Nodes in k-Group | Solution | |
26 | Remove Duplicates from Sorted Array | Easy | Solution |
27 | Remove Element | Solution | |
28 | Implement strStr() | Easy | Solution |
29 | Divide Two Integers | Medium | Solution |
30 | Substring with Concatenation of All Words | Solution | |
31 | Next Permutation | Medium | Solution |
32 | Longest Valid Parentheses | Hard | Solution |
33 | Search in Rotated Sorted Array | Medium | Solution |
34 | Search for a Range | Solution | |
35 | Search Insert Position | Easy | Solution |
36 | Valid Sudoku | Solution | |
38 | Count and Say | Solution | |
39 | Combination Sum | Medium | Solution |
40 | Combination Sum II | Medium | Solution |
41 | First Missing Positive | Hard | Solution |
42 | Trapping Rain Water | Hard | Solution |
43 | Multiply Strings | Solution | |
44 | Wildcard Matching | Hard | Solution |
45 | Jump Game II | Hard | Solution |
46 | Permutations | Medium | Solution |
47 | Permutations II | Medium | Solution |
48 | Rotate Image | Solution | |
49 | Group Anagrams | Medium | Solution |
50 | Pow(x, n) | Medium | Solution |
53 | Maximum Subarray | Easy | Solution |
54 | Spiral Matrix | Medium | Solution |
55 | Jump Game | Medium | Solution |
57 | Insert Interval | Hard | Solution |
58 | Length of Last Word | Easy | Solution |
59 | Spiral Matrix II | Medium | Solution |
60 | Permutation Sequence | Medium | Solution |
61 | Rotate List | Medium | Solution |
62 | Unique Paths | Medium | Solution |
63 | Unique Paths II | Medium | Solution |
64 | Minimum Path Sum | Medium | Solution |
65 | Valid Number | Hard | Solution |
66 | Plus One | Easy | Solution |
67 | Add Binary | Easy | Solution |
69 | Sqrt(x) | Solution | |
70 | Climbing Stairs | Easy | Solution |
71 | Simplify Path | Solution | |
72 | Edit Distance | Hard | Solution |
74 | Search a 2D Matrix | Medium | Solution |
75 | Sort Colors | Medium | Solution |
76 | Minimum Window Substring | Hard | Solution |
77 | Combinations | Medium | Solution |
78 | Subsets | Medium | Solution |
79 | Word Search | Medium | Solution |
80 | Remove Duplicates from Sorted Array II | Medium | Solution |
81 | Search in Rotated Sorted Array II | Medium | Solution |
82 | Remove Duplicates from Sorted List II | Medium | Solution |
83 | Remove Duplicates from Sorted List | Solution | |
84 | Largest Rectangle in Histogram | Hard | Solution |
85 | Maximal Rectangle | Hard | Solution |
86 | Partition List | Medium | Solution |
87 | Scramble String | Hard | Solution |
88 | Merge Sorted Array | Easy | Solution |
89 | Gray Code | Medium | Solution |
90 | Subsets II | Medium | Solution |
91 | Decode Ways | Medium | Solution |
92 | Reverse Linked List II | Medium | Solution |
93 | Restore IP Addresses | Solution | |
94 | Binary Tree Inorder Traversal | Medium | Solution |
95 | Unique Binary Search Trees II | Medium | Solution |
96 | Unique Binary Search Trees | Medium | Solution |
97 | Interleaving String | Hard | Solution |
98 | Validate Binary Search Tree | Medium | Solution |
99 | Recover Binary Search Tree | Hard | Solution |
100 | Same Tree | Easy | Solution |
101 | Symmetric Tree | Solution | |
102 | Binary Tree Level Order Traversal | Medium | Solution |
103 | Binary Tree Zigzag Level Order Traversal | Medium | Solution |
104 | Maximum Depth of Binary Tree | Easy | Solution |
106 | Construct Binary Tree from Inorder and Postorder Traversal | Solution | |
107 | Binary Tree Level Order Traversal II | Easy | Solution |
108 | Convert Sorted Array to Binary Search Tree | Solution | |
109 | Convert Sorted List to Binary Search Tree | Solution | |
110 | Balanced Binary Tree | Solution | |
111 | Minimum Depth of Binary Tree | Easy | Solution |
112 | Path Sum | Solution | |
113 | Path Sum II | Solution | |
114 | Flatten Binary Tree to Linked List | Solution | |
115 | Distinct Subsequences | Hard | Solution |
116 | Populating Next Right Pointers in Each Node | Medium | Solution |
117 | Populating Next Right Pointers in Each Node II | Medium | Solution |
118 | Pascal's Triangle | Easy | Solution |
119 | Pascal's Triangle II | Easy | Solution |
121 | Best Time to Buy and Sell Stock | Easy | Solution |
122 | Best Time to Buy and Sell Stock II | Easy | Solution |
123 | Best Time to Buy and Sell Stock III | Hard | Solution |
124 | Binary Tree Maximum Path Sum | Hard | Solution |
125 | Valid Palindrome | Easy | Solution |
126 | Word Ladder II | Solution | |
127 | Word Ladder | Hard | Solution |
128 | Longest Consecutive Sequence | Hard | Solution |
129 | Sum Root to Leaf Numbers | Medium | Solution |
130 | Surrounded Regions | Medium | Solution |
131 | Palindrome Partitioning | Medium | Solution |
133 | Clone Graph | Medium | Solution |
134 | Gas Station | Medium | Solution |
136 | Single Number | Easy | Solution |
137 | Single Number II | Medium | Solution |
138 | Copy List with Random Pointer | Solution | |
139 | Word Break | Medium | Solution |
140 | Word Break II | Hard | Solution |
141 | Linked List Cycle | Solution | |
142 | Linked List Cycle II | Medium | Solution |
143 | Reorder List | Medium | Solution |
144 | Binary Tree Preorder Traversal | Medium | Solution |
145 | Binary Tree Postorder Traversal | Hard | Solution |
146 | LRU Cache | Hard | Solution |
147 | Insertion Sort List | Medium | Solution |
148 | Sort List | Medium | Solution |
149 | Max Points on a Line | Hard | Solution |
150 | Evaluate Reverse Polish Notation | Solution | |
151 | Reverse Words in a String | Medium | Solution |
152 | Maximum Product Subarray | Medium | Solution |
153 | Find Minimum in Rotated Sorted Array | Medium | Solution |
154 | Find Minimum in Rotated Sorted Array II | Hard | Solution |
155 | Min Stack | Easy | Solution |
156 | Binary Tree Upside Down | Medium | Solution |
157 | Read N Characters Given Read4 | Easy | Solution |
158 | Read N Characters Given Read4 II - Call multiple times | Hard | Solution |
159 | Longest Substring with At Most Two Distinct Characters | Hard | Solution |
161 | One Edit Distance | Medium | Solution |
162 | Find Peak Element | Medium | Solution |
164 | Maximum Gap | Solution | |
165 | Compare Version Numbers | Medium | Solution |
166 | Fraction to Recurring Decimal | Solution | |
167 | Two Sum II - Input array is sorted | Solution | |
169 | Majority Element | Easy | Solution |
171 | Excel Sheet Column Number | Easy | Solution |
173 | Binary Search Tree Iterator | Medium | Solution |
174 | Dungeon Game | Hard | Solution |
175 | Combine Two Tables | Easy | Solution |
176 | Second Highest Salary | Easy | Solution |
179 | Largest Number | Medium | Solution |
181 | Employees Earning More Than Their Managers | Easy | Solution |
182 | Duplicate Emails | Easy | Solution |
187 | Repeated DNA Sequences | Solution | |
188 | Best Time to Buy and Sell Stock IV | Hard | Solution |
189 | Rotate Array | Medium | Solution |
190 | Reverse Bits | Easy | Solution |
195 | Tenth Line | Easy | Solution |
198 | House Robber | Easy | Solution |
200 | Number of Islands | Medium | Solution |
201 | Bitwise AND of Numbers Range | Medium | Solution |
202 | Happy Number | Easy | Solution |
203 | Remove Linked List Elements | Easy | Solution |
204 | Count Primes | Easy | Solution |
206 | Reverse Linked List | Easy | Solution |
207 | Course Schedule | Medium | Solution |
208 | Implement Trie (Prefix Tree) | Medium | Solution |
209 | Minimum Size Subarray Sum | Medium | Solution |
210 | Course Schedule II | Medium | Solution |
211 | Add and Search Word - Data structure design | Medium | Solution |
212 | Word Search II | Hard | Solution |
213 | House Robber II | Medium | Solution |
214 | Shortest Palindrome | Solution | |
215 | Kth Largest Element in an Array | Medium | Solution |
216 | Combination Sum III | Medium | Solution |
218 | The Skyline Problem | Hard | Solution |
219 | Contains Duplicate II | Easy | Solution |
220 | Contains Duplicate III | Medium | Solution |
221 | Maximal Square | Medium | Solution |
222 | Count Complete Tree Nodes | Medium | Solution |
223 | Rectangle Area | Solution | |
224 | Basic Calculator | Hard | Solution |
225 | Implement Stack using Queues | Easy | Solution |
226 | Invert Binary Tree | Easy | Solution |
227 | Basic Calculator II | Medium | Solution |
228 | Summary Ranges | Easy | Solution |
229 | Majority Element II | Solution | |
230 | Kth Smallest Element in a BST | Medium | Solution |
231 | Power of Two | Easy | Solution |
232 | Implement Queue using Stacks | Easy | Solution |
234 | Palindrome Linked List | Easy | Solution |
237 | Delete Node in a Linked List | Easy | Solution |
238 | Product of Array Except Self | Medium | Solution |
239 | Sliding Window Maximum | Hard | Solution |
240 | Search a 2D Matrix II | Solution | |
241 | Different Ways to Add Parentheses | Medium | Solution |
243 | Shortest Word Distance | Easy | Solution |
244 | Shortest Word Distance II | Medium | Solution |
246 | Strobogrammatic Number | Easy | Solution |
247 | Strobogrammatic Number II | Medium | Solution |
249 | Group Shifted Strings | Medium | Solution |
250 | Count Univalue Subtrees | Medium | Solution |
252 | Meeting Rooms | Easy | Solution |
253 | Meeting Rooms II | Medium | Solution |
256 | Paint House | Easy | Solution |
257 | Binary Tree Paths | Easy | Solution |
258 | Add Digits | Easy | Solution |
259 | 3Sum Smaller | Medium | Solution |
260 | Single Number III | Medium | Solution |
261 | Graph Valid Tree | Medium | Solution |
263 | Ugly Number | Solution | |
264 | Ugly Number II | Medium | Solution |
266 | Palindrome Permutation | Easy | Solution |
268 | Missing Number | Easy | Solution |
270 | Closest Binary Search Tree Value | Easy | Solution |
271 | Encode and Decode Strings | Medium | Solution |
274 | H-Index | Medium | Solution |
275 | H-Index II | Medium | Solution |
278 | First Bad Version | Easy | Solution |
279 | Perfect Squares | Medium | Solution |
280 | Wiggle Sort | Medium | Solution |
281 | Zigzag Iterator | Medium | Solution |
285 | Inorder Successor in BST | Medium | Solution |
287 | Find the Duplicate Number | Medium | Solution |
289 | Game of Life | Medium | Solution |
290 | Word Pattern | Easy | Solution |
293 | Flip Game | Easy | Solution |
295 | Find Median from Data Stream | Hard | Solution |
297 | Serialize and Deserialize Binary Tree | Hard | Solution |
298 | Binary Tree Longest Consecutive Sequence | Medium | Solution |
299 | Bulls and Cows | Easy | Solution |
300 | Longest Increasing Subsequence | Medium | Solution |
301 | Remove Invalid Parentheses | Hard | Solution |
303 | Range Sum Query - Immutable | Solution | |
304 | Range Sum Query 2D - Immutable | Solution | |
307 | Range Sum Query - Mutable | Medium | Solution |
309 | Best Time to Buy and Sell Stock with Cooldown | Medium | Solution |
310 | Minimum Height Trees | Medium | Solution |
312 | Burst Balloons | Hard | Solution |
313 | Super Ugly Number | Solution | |
315 | Count of Smaller Numbers After Self | Hard | Solution |
316 | Remove Duplicate Letters | Hard | Solution |
320 | Generalized Abbreviation | Medium | Solution |
321 | Create Maximum Number | Hard | Solution |
322 | Coin Change | Solution | |
324 | Wiggle Sort II | Solution | |
327 | Count of Range Sum | Hard | Solution |
328 | Odd Even Linked List | Medium | Solution |
329 | Longest Increasing Path in a Matrix | Hard | Solution |
330 | Patching Array | Solution | |
331 | Verify Preorder Serialization of a Binary Tree | Solution | |
332 | Reconstruct Itinerary | Medium | Solution |
333 | Largest BST Subtree | Medium | Solution |
334 | Increasing Triplet Subsequence | Medium | Solution |
335 | Self Crossing | Solution | |
336 | Palindrome Pairs | Hard | Solution |
337 | House Robber III | Medium | Solution |
338 | Counting Bits | Medium | Solution |
339 | Nested List Weight Sum | Easy | Solution |
340 | Longest Substring with At Most K Distinct Characters | Hard | Solution |
341 | Flatten Nested List Iterator | Medium | Solution |
342 | Power of Four | Easy | Solution |
343 | Integer Break | Medium | Solution |
344 | Reverse String | Easy | Solution |
345 | Reverse Vowels of a String | Easy | Solution |
346 | Moving Average from Data Stream | Easy | Solution |
347 | Top K Frequent Elements | Medium | Solution |
348 | Design Tic-Tac-Toe | Medium | Solution |
349 | Intersection of Two Arrays | Solution | |
350 | Intersection of Two Arrays II | Solution | |
352 | Data Stream as Disjoint Intervals | Solution | |
354 | Russian Doll Envelopes | Hard | Solution |
355 | Design Twitter | Medium | Solution |
357 | Count Numbers with Unique Digits | Solution | |
359 | Logger Rate Limiter | Easy | Solution |
360 | Sort Transformed Array | Medium | Solution |
361 | Bomb Enemy | Medium | Solution |
363 | Max Sum of Rectangle No Larger Than K | Hard | Solution |
364 | Nested List Weight Sum II | Medium | Solution |
365 | Water and Jug Problem | Solution | |
366 | Find Leaves of Binary Tree | Medium | Solution |
367 | Valid Perfect Square | Easy | Solution |
368 | Largest Divisible Subset | Medium | Solution |
369 | Plus One Linked List | Medium | Solution |
370 | Range Addition | Medium | Solution |
371 | Sum of Two Integers | Easy | Solution |
372 | Super Pow | Solution | |
373 | Find K Pairs with Smallest Sums | Solution | |
374 | Guess Number Higher or Lower | Solution | |
375 | Guess Number Higher or Lower II | Medium | Solution |
376 | Wiggle Subsequence | Medium | Solution |
377 | Combination Sum IV | Medium | Solution |
378 | Kth Smallest Element in a Sorted Matrix | Solution | |
379 | Design Phone Directory | Medium | Solution |
380 | Insert Delete GetRandom O(1) | Medium | Solution |
381 | Insert Delete GetRandom O(1) - Duplicates allowed | Hard | Solution |
382 | Linked List Random Node | Medium | Solution |
383 | Ransom Note | Easy | Solution |
384 | Shuffle an Array | Solution | |
385 | Mini Parser | Medium | Solution |
386 | Lexicographical Numbers | Medium | Solution |
387 | First Unique Character in a String | Easy | Solution |
388 | Longest Absolute File Path | Medium | Solution |
389 | Find the Difference | Easy | Solution |
390 | Elimination Game | Solution | |
391 | Perfect Rectangle | Solution | |
392 | Is Subsequence | Easy | Solution |
393 | UTF-8 Validation | Solution | |
394 | Decode String | Solution | |
395 | Longest Substring with At Least K Repeating Characters | Medium | Solution |
396 | Rotate Function | Medium | Solution |
397 | Integer Replacement | Solution | |
398 | Random Pick Index | Solution | |
399 | Evaluate Division | Medium | Solution |
400 | Nth Digit | Medium | Solution |
401 | Binary Watch | Solution | |
402 | Remove K Digits | Medium | Solution |
403 | Frog Jump | Hard | Solution |
404 | Sum of Left Leaves | Easy | Solution |
405 | Convert a Number to Hexadecimal | Solution | |
406 | Queue Reconstruction by Height | Medium | Solution |
407 | Trapping Rain Water II | Solution | |
408 | Valid Word Abbreviation | Easy | Solution |
409 | Longest Palindrome | Easy | Solution |
410 | Split Array Largest Sum | Hard | Solution |
412 | Fizz Buzz | Easy | Solution |
413 | Arithmetic Slices | Medium | Solution |
414 | Third Maximum Number | Solution | |
415 | Add Strings | Easy | Solution |
416 | Partition Equal Subset Sum | Medium | Solution |
417 | Pacific Atlantic Water Flow | Solution | |
419 | Battleships in a Board | Solution | |
420 | Strong Password Checker | Solution | |
421 | Maximum XOR of Two Numbers in an Array | Medium | Solution |
422 | Valid Word Square | Easy | Solution |
423 | Reconstruct Original Digits from English | Solution | |
424 | Longest Repeating Character Replacement | Solution | |
427 | Construct Quad Tree | Easy | Solution |
429 | N-ary Tree Level Order Traversal | Easy | Solution |
430 | Flatten a Multilevel Doubly Linked List | Medium | Solution |
432 | All O`one Data Structure | Solution | |
434 | Number of Segments in a String | Solution | |
435 | Non-overlapping Intervals | Medium | Solution |
436 | Find Right Interval | Medium | Solution |
437 | Path Sum III | Medium | Solution |
438 | Find All Anagrams in a String | Medium | Solution |
440 | K-th Smallest in Lexicographical Order | Solution | |
441 | Arranging Coins | Easy | Solution |
442 | Find All Duplicates in an Array | Medium | Solution |
443 | String Compression | Easy | Solution |
445 | Add Two Numbers II | Medium | Solution |
446 | Arithmetic Slices II - Subsequence | Hard | Solution |
447 | Number of Boomerangs | Solution | |
448 | Find All Numbers Disappeared in an Array | Solution | |
449 | Serialize and Deserialize BST | Solution | |
450 | Delete Node in a BST | Medium | Solution |
451 | Sort Characters By Frequency | Medium | Solution |
452 | Minimum Number of Arrows to Burst Balloons | Medium | Solution |
453 | Minimum Moves to Equal Array Elements | Solution | |
454 | 4Sum II | Medium | Solution |
455 | Assign Cookies | Solution | |
456 | 132 Pattern | Medium | Solution |
457 | Circular Array Loop | Medium | Solution |
459 | Repeated Substring Pattern | Easy | Solution |
460 | LFU Cache | Solution | |
461 | Hamming Distance | Easy | Solution |
462 | Minimum Moves to Equal Array Elements II | Solution | |
463 | Island Perimeter | Easy | Solution |
464 | Can I Win | Solution | |
466 | Count The Repetitions | Hard | Solution |
467 | Unique Substrings in Wraparound String | Solution | |
468 | Validate IP Address | Medium | Solution |
470 | Implement Rand10() Using Rand7() | Medium | Solution |
471 | Encode String with Shortest Length | Hard | Solution |
472 | Concatenated Words | Hard | Solution |
473 | Matchsticks to Square | Medium | Solution |
474 | Ones and Zeroes | Medium | Solution |
475 | Heaters | Solution | |
476 | Number Complement | Easy | Solution |
477 | Total Hamming Distance | Solution | |
478 | Generate Random Point in a Circle | Medium | Solution |
480 | Sliding Window Median | Solution | |
481 | Magical String | Solution | |
482 | License Key Formatting | Solution | |
483 | Smallest Good Base | Hard | Solution |
485 | Max Consecutive Ones | Solution | |
486 | Predict the Winner | Medium | Solution |
487 | Max Consecutive Ones II | Solution | |
488 | Zuma Game | Solution | |
489 | Robot Room Cleaner | Hard | Solution |
490 | The Maze | Medium | Solution |
491 | Increasing Subsequences | Medium | Solution |
492 | Construct the Rectangle | Solution | |
494 | Target Sum | Medium | Solution |
495 | Teemo Attacking | Medium | Solution |
496 | Next Greater Element I | Easy | Solution |
497 | Random Point in Non-overlapping Rectangles | Medium | Solution |
498 | Diagonal Traverse | Solution | |
500 | Keyboard Row | Solution | |
501 | Find Mode in Binary Search Tree | Solution | |
502 | IPO | Solution | |
503 | Next Greater Element II | Medium | Solution |
504 | Base 7 | Solution | |
506 | Relative Ranks | Solution | |
507 | Perfect Number | Easy | Solution |
508 | Most Frequent Subtree Sum | Solution | |
509 | Fibonacci Number | Easy | Solution |
513 | Find Bottom Left Tree Value | Medium | Solution |
514 | Freedom Trail | Hard | Solution |
515 | Find Largest Value in Each Tree Row | Solution | |
516 | Longest Palindromic Subsequence | Medium | Solution |
517 | Super Washing Machines | Hard | Solution |
518 | Coin Change 2 | Medium | Solution |
519 | Random Flip Matrix | Medium | Solution |
520 | Detect Capital | Easy | Solution |
521 | Longest Uncommon Subsequence I | Easy | Solution |
523 | Continuous Subarray Sum | Medium | Solution |
524 | Longest Word in Dictionary through Deleting | Solution | |
525 | Contiguous Array | Medium | Solution |
526 | Beautiful Arrangement | Medium | Solution |
528 | Random Pick with Weight | Medium | Solution |
529 | Minesweeper | Solution | |
530 | Minimum Absolute Difference in BST | Solution | |
532 | K-diff Pairs in an Array | Easy | Solution |
535 | Encode and Decode TinyURL | Solution | |
536 | Construct Binary Tree from String | Solution | |
537 | Complex Number Multiplication | Medium | Solution |
538 | Convert BST to Greater Tree | Solution | |
539 | Minimum Time Difference | Solution | |
540 | Single Element in a Sorted Array | Medium | Solution |
541 | Reverse String II | Solution | |
542 | 01 Matrix | Solution | |
543 | Diameter of Binary Tree | Easy | Solution |
544 | Output Contest Matches | Medium | Solution |
546 | Remove Boxes | Hard | Solution |
547 | Friend Circles | Medium | Solution |
549 | Binary Tree Longest Consecutive Sequence II | Solution | |
551 | Student Attendance Record I | Easy | Solution |
552 | Student Attendance Record II | Hard | Solution |
553 | Optimal Division | Medium | Solution |
554 | Brick Wall | Medium | Solution |
556 | Next Greater Element III | Medium | Solution |
557 | Reverse Words in a String III | Solution | |
558 | Quad Tree Intersection | Easy | Solution |
559 | Maximum Depth of N-ary Tree | Easy | Solution |
560 | Subarray Sum Equals K | Medium | Solution |
561 | Array Partition I | Solution | |
562 | Longest Line of Consecutive One in Matrix | Solution | |
563 | Binary Tree Tilt | Easy | Solution |
565 | Array Nesting | Medium | Solution |
566 | Reshape the Matrix | Easy | Solution |
567 | Permutation in String | Medium | Solution |
570 | Managers with at Least 5 Direct Reports | Medium | Solution |
572 | Subtree of Another Tree | Easy | Solution |
575 | Distribute Candies | Easy | Solution |
576 | Out of Boundary Paths | Medium | Solution |
577 | Employee Bonus | Easy | Solution |
581 | Shortest Unsorted Continuous Subarray | Easy | Solution |
582 | Kill Process | Medium | Solution |
583 | Delete Operation for Two Strings | Medium | Solution |
584 | Find Customer Referee | Easy | Solution |
586 | Customer Placing the Largest Number of Orders | Easy | Solution |
589 | N-ary Tree Preorder Traversal | Easy | Solution |
590 | N-ary Tree Postorder Traversal | Easy | Solution |
591 | Tag Validator | Hard | Solution |
593 | Valid Square | Medium | Solution |
594 | Longest Harmonious Subsequence | Easy | Solution |
595 | Big Countries | Easy | Solution |
597 | Friend Requests I: Overall Acceptance Rate | Easy | Solution |
598 | Range Addition II | Easy | Solution |
599 | Minimum Index Sum of Two Lists | Easy | Solution |
600 | Non-negative Integers without Consecutive Ones | Hard | Solution |
603 | Consecutive Available Seats | Easy | Solution |
604 | Design Compressed String Iterator | Easy | Solution |
605 | Can Place Flowers | Easy | Solution |
606 | Construct String from Binary Tree | Easy | Solution |
607 | Sales Person | Easy | Solution |
609 | Find Duplicate File in System | Medium | Solution |
610 | Triangle Judgement | Easy | Solution |
611 | Valid Triangle Number | Medium | Solution |
613 | Shortest Distance in a Line | Easy | Solution |
616 | Add Bold Tag in String | Medium | Solution |
617 | Merge Two Binary Trees | Easy | Solution |
620 | Not Boring Movies | Easy | Solution |
621 | Task Scheduler | Medium | Solution |
622 | Design Circular Queue | Medium | Solution |
627 | Swap Salary | Easy | Solution |
628 | Maximum Product of Three Numbers | Easy | Solution |
629 | K Inverse Pairs Array | Hard | Solution |
632 | Smallest Range Covering Elements from K Lists | Hard | Solution |
636 | Exclusive Time of Functions | Medium | Solution |
637 | Average of Levels in Binary Tree | Easy | Solution |
638 | Shopping Offers | Medium | Solution |
639 | Decode Ways II | Hard | Solution |
640 | Solve the Equation | Medium | Solution |
641 | Design Circular Deque | Medium | Solution |
643 | Maximum Average Subarray I | Easy | Solution |
645 | Set Mismatch | Easy | Solution |
646 | Maximum Length of Pair Chain | Medium | Solution |
647 | Palindromic Substrings | Medium | Solution |
648 | Replace Words | Medium | Solution |
650 | 2 Keys Keyboard | Medium | Solution |
651 | 4 Keys Keyboard | Medium | Solution |
652 | Find Duplicate Subtrees | Medium | Solution |
653 | Two Sum IV - Input is a BST | Easy | Solution |
654 | Maximum Binary Tree | Medium | Solution |
655 | Print Binary Tree | Medium | Solution |
657 | Robot Return to Origin | Easy | Solution |
659 | Split Array into Consecutive Subsequences | Medium | Solution |
661 | Image Smoother | Easy | Solution |
662 | Maximum Width of Binary Tree | Medium | Solution |
663 | Equal Tree Partition | Medium | Solution |
664 | Strange Printer | Hard | Solution |
665 | Non-decreasing Array | Easy | Solution |
666 | Path Sum IV | Medium | Solution |
667 | Beautiful Arrangement II | Medium | Solution |
668 | Kth Smallest Number in Multiplication Table | Hard | Solution |
669 | Trim a Binary Search Tree | Easy | Solution |
670 | Maximum Swap | Medium | Solution |
671 | Second Minimum Node In a Binary Tree | Easy | Solution |
673 | Number of Longest Increasing Subsequence | Medium | Solution |
674 | Longest Continuous Increasing Subsequence | Easy | Solution |
676 | Implement Magic Dictionary | Medium | Solution |
677 | Map Sum Pairs | Medium | Solution |
678 | Valid Parenthesis String | Medium | Solution |
680 | Valid Palindrome II | Easy | Solution |
682 | Baseball Game | Easy | Solution |
684 | Redundant Connection | Medium | Solution |
686 | Repeated String Match | Medium | Solution |
687 | Longest Univalue Path | Easy | Solution |
688 | Knight Probability in Chessboard | Medium | Solution |
690 | Employee Importance | Easy | Solution |
691 | Stickers to Spell Word | Hard | Solution |
693 | Binary Number with Alternating Bits | Easy | Solution |
694 | Number of Distinct Islands | Medium | Solution |
695 | Max Area of Island | Medium | Solution |
696 | Count Binary Substrings | Easy | Solution |
697 | Degree of an Array | Easy | Solution |
698 | Partition to K Equal Sum Subsets | Medium | Solution |
699 | Falling Squares | Hard | Solution |
700 | Search in a Binary Search Tree | Easy | Solution |
701 | Insert into a Binary Search Tree | Medium | Solution |
702 | Search in a Sorted Array of Unknown Size | Medium | Solution |
703 | Kth Largest Element in a Stream | Easy | Solution |
704 | Binary Search | Easy | Solution |
705 | Design HashSet | Easy | Solution |
706 | Design HashMap | Easy | Solution |
707 | Design Linked List | Easy | Solution |
709 | To Lower Case | Easy | Solution |
712 | Minimum ASCII Delete Sum for Two Strings | Medium | Solution |
713 | Subarray Product Less Than K | Medium | Solution |
714 | Best Time to Buy and Sell Stock with Transaction Fee | Medium | Solution |
717 | 1-bit and 2-bit Characters | Easy | Solution |
718 | Maximum Length of Repeated Subarray | Medium | Solution |
719 | Find K-th Smallest Pair Distance | Hard | Solution |
720 | Longest Word in Dictionary | Easy | Solution |
721 | Accounts Merge | Medium | Solution |
723 | Candy Crush | Medium | Solution |
724 | Find Pivot Index | Easy | Solution |
725 | Split Linked List in Parts | Medium | Solution |
726 | Number of Atoms | Hard | Solution |
728 | Self Dividing Numbers | Easy | Solution |
730 | Count Different Palindromic Subsequences | Hard | Solution |
733 | Flood Fill | Easy | Solution |
735 | Asteroid Collision | Medium | Solution |
739 | Daily Temperatures | Medium | Solution |
740 | Delete and Earn | Medium | Solution |
743 | Network Delay Time | Medium | Solution |
744 | Find Smallest Letter Greater Than Target | Easy | Solution |
745 | Prefix and Suffix Search | Hard | Solution |
746 | Min Cost Climbing Stairs | Easy | Solution |
747 | Largest Number At Least Twice of Others | Easy | Solution |
748 | Shortest Completing Word | Easy | Solution |
750 | Number Of Corner Rectangles | Medium | Solution |
751 | IP to CIDR | Hard | Solution |
752 | Open the Lock | Medium | Solution |
753 | Cracking the Safe | Hard | Solution |
754 | Reach a Number | Easy | Solution |
755 | Pour Water | Medium | Solution |
756 | Pyramid Transition Matrix | Medium | Solution |
757 | Set Intersection Size At Least Two | Hard | Solution |
760 | Find Anagram Mappings | Easy | Solution |
762 | Prime Number of Set Bits in Binary Representation | Easy | Solution |
763 | Partition Labels | Medium | Solution |
765 | Couples Holding Hands | Hard | Solution |
766 | Toeplitz Matrix | Easy | Solution |
767 | Reorganize String | Medium | Solution |
768 | Max Chunks To Make Sorted II | Hard | Solution |
769 | Max Chunks To Make Sorted | Medium | Solution |
770 | Basic Calculator IV | Hard | Solution |
771 | Jewels and Stones | Easy | Solution |
773 | Sliding Puzzle | Hard | Solution |
775 | Global and Local Inversions | Medium | Solution |
777 | Swap Adjacent in LR String | Medium | Solution |
780 | Reaching Points | Hard | Solution |
781 | Rabbits in Forest | Medium | Solution |
783 | Minimum Distance Between BST Nodes | Medium | Solution |
784 | Letter Case Permutation | Easy | Solution |
785 | Is Graph Bipartite? | Medium | Solution |
787 | Cheapest Flights Within K Stops | Medium | Solution |
788 | Rotated Digits | Easy | Solution |
791 | Custom Sort String | Medium | Solution |
793 | Preimage Size of Factorial Zeroes Function | Hard | Solution |
794 | Valid Tic-Tac-Toe State | Medium | Solution |
795 | Number of Subarrays with Bounded Maximum | Medium | Solution |
796 | Rotate String | Easy | Solution |
797 | All Paths From Source to Target | Medium | Solution |
798 | Smallest Rotation with Highest Score | Hard | Solution |
799 | Champagne Tower | Medium | Solution |
800 | Similar RGB Color | Easy | Solution |
801 | Minimum Swaps To Make Sequences Increasing | Medium | Solution |
802 | Find Eventual Safe States | Medium | Solution |
804 | Unique Morse Code Words | Easy | Solution |
805 | Split Array With Same Average | Hard | Solution |
806 | Number of Lines To Write String | Easy | Solution |
807 | Max Increase to Keep City Skyline | Medium | Solution |
809 | Expressive Words | Medium | Solution |
811 | Subdomain Visit Count | Easy | Solution |
812 | Largest Triangle Area | Easy | Solution |
813 | Largest Sum of Averages | Medium | Solution |
814 | Binary Tree Pruning | Medium | Solution |
817 | Linked List Components | Medium | Solution |
819 | Most Common Word | Easy | Solution |
821 | Shortest Distance to a Character | Easy | Solution |
823 | Binary Trees With Factors | Medium | Solution |
824 | Goat Latin | Easy | Solution |
825 | Friends Of Appropriate Ages | Medium | Solution |
826 | Most Profit Assigning Work | Medium | Solution |
827 | Making A Large Island | Hard | Solution |
828 | Unique Letter String | Hard | Solution |
829 | Consecutive Numbers Sum | Hard | Solution |
830 | Positions of Large Groups | Easy | Solution |
831 | Masking Personal Information | Medium | Solution |
832 | Flipping an Image | Easy | Solution |
835 | Image Overlap | Medium | Solution |
836 | Rectangle Overlap | Easy | Solution |
837 | New 21 Game | Medium | Solution |
839 | Similar String Groups | Hard | Solution |
840 | Magic Squares In Grid | Easy | Solution |
841 | Keys and Rooms | Medium | Solution |
843 | Guess the Word | Hard | Solution |
844 | Backspace String Compare | Easy | Solution |
845 | Longest Mountain in Array | Medium | Solution |
846 | Hand of Straights | Medium | Solution |
849 | Maximize Distance to Closest Person | Medium | Solution |
852 | Peak Index in a Mountain Array | Easy | Solution |
855 | Exam Room | Medium | Solution |
856 | Score of Parentheses | Medium | Solution |
857 | Minimum Cost to Hire K Workers | Hard | Solution |
858 | Mirror Reflection | Medium | Solution |
859 | Buddy Strings | Easy | Solution |
860 | Lemonade Change | Easy | Solution |
861 | Score After Flipping Matrix | Medium | Solution |
862 | Shortest Subarray with Sum at Least K | Hard | Solution |
863 | All Nodes Distance K in Binary Tree | Medium | Solution |
865 | Smallest Subtree with all the Deepest Nodes | Medium | Solution |
866 | Prime Palindrome | Medium | Solution |
867 | Transpose Matrix | Easy | Solution |
868 | Binary Gap | Easy | Solution |
869 | Reordered Power of 2 | Medium | Solution |
870 | Advantage Shuffle | Medium | Solution |
872 | Leaf-Similar Trees | Easy | Solution |
874 | Walking Robot Simulation | Easy | Solution |
875 | Koko Eating Bananas | Medium | Solution |
876 | Middle of the Linked List | Easy | Solution |
877 | Stone Game | Medium | Solution |
880 | Decoded String at Index | Medium | Solution |
881 | Boats to Save People | Medium | Solution |
882 | Reachable Nodes In Subdivided Graph | Hard | Solution |
883 | Projection Area of 3D Shapes | Easy | Solution |
884 | Uncommon Words from Two Sentences | Easy | Solution |
885 | Spiral Matrix III | Medium | Solution |
886 | Possible Bipartition | Medium | Solution |
887 | Super Egg Drop | Hard | Solution |
888 | Fair Candy Swap | Easy | Solution |
889 | Construct Binary Tree from Preorder and Postorder Traversal | Medium | Solution |
890 | Find and Replace Pattern | Medium | Solution |
891 | Sum of Subsequence Widths | Solution | |
892 | Surface Area of 3D Shapes | Easy | Solution |
893 | Groups of Special-Equivalent Strings | Easy | Solution |
894 | All Possible Full Binary Trees | Medium | Solution |
896 | Monotonic Array | Easy | Solution |
897 | Increasing Order Search Tree | Easy | Solution |
899 | Orderly Queue | Hard | Solution |
900 | RLE Iterator | Medium | Solution |
901 | Online Stock Span | Medium | Solution |
902 | Numbers At Most N Given Digit Set | Hard | Solution |
903 | Valid Permutations for DI Sequence | Hard | Solution |
905 | Sort Array By Parity | Easy | Solution |
906 | Super Palindromes | Hard | Solution |
908 | Smallest Range I | Easy | Solution |
911 | Online Election | Medium | Solution |
912 | Sort an Array | Medium | Solution |
913 | Cat and Mouse | Hard | Solution |
914 | X of a Kind in a Deck of Cards | Easy | Solution |
916 | Word Subsets | Medium | Solution |
917 | Reverse Only Letters | Easy | Solution |
918 | Maximum Sum Circular Subarray | Medium | Solution |
919 | Complete Binary Tree Inserter | Medium | Solution |
920 | Number of Music Playlists | Hard | Solution |
921 | Minimum Add to Make Parentheses Valid | Medium | Solution |
922 | Sort Array By Parity II | Easy | Solution |
923 | 3Sum With Multiplicity | Medium | Solution |
924 | Minimize Malware Spread | Hard | Solution |
925 | Long Pressed Name | Easy | Solution |
926 | Flip String to Monotone Increasing | Medium | Solution |
928 | Minimize Malware Spread II | Hard | Solution |
929 | Unique Email Addresses | Easy | Solution |
930 | Binary Subarrays With Sum | Medium | Solution |
931 | Minimum Falling Path Sum | Medium | Solution |
932 | Beautiful Array | Medium | Solution |
933 | Number of Recent Calls | Easy | Solution |
935 | Knight Dialer | Medium | Solution |
936 | Stamping The Sequence | Hard | Solution |
937 | Reorder Log Files | Easy | Solution |
938 | Range Sum of BST | Easy | Solution |
939 | Minimum Area Rectangle | Medium | Solution |
940 | Distinct Subsequences II | Hard | Solution |
941 | Valid Mountain Array | Easy | Solution |
942 | DI String Match | Easy | Solution |
943 | Find the Shortest Superstring | Hard | Solution |
944 | Delete Columns to Make Sorted | Easy | Solution |
945 | Minimum Increment to Make Array Unique | Medium | Solution |
946 | Validate Stack Sequences | Medium | Solution |
947 | Most Stones Removed with Same Row or Column | Medium | Solution |
948 | Bag of Tokens | Medium | Solution |
949 | Largest Time for Given Digits | Easy | Solution |
950 | Reveal Cards In Increasing Order | Medium | Solution |
951 | Flip Equivalent Binary Trees | Medium | Solution |
952 | Largest Component Size by Common Factor | Hard | Solution |
953 | Verifying an Alien Dictionary | Easy | Solution |
954 | Array of Doubled Pairs | Medium | Solution |
955 | Delete Columns to Make Sorted II | Medium | Solution |
956 | Tallest Billboard | Hard | Solution |
957 | Prison Cells After N Days | Medium | Solution |
958 | Check Completeness of a Binary Tree | Medium | Solution |
959 | Regions Cut By Slashes | Medium | Solution |
960 | Delete Columns to Make Sorted III | Hard | Solution |
961 | N-Repeated Element in Size 2N Array | Easy | Solution |
962 | Maximum Width Ramp | Medium | Solution |
967 | Numbers With Same Consecutive Differences | Medium | Solution |
968 | Binary Tree Cameras | Hard | Solution |
969 | Pancake Sorting | Medium | Solution |
970 | Powerful Integers | Easy | Solution |
971 | Flip Binary Tree To Match Preorder Traversal | Medium | Solution |
973 | K Closest Points to Origin | Easy | Solution |
977 | Squares of a Sorted Array | Easy | Solution |
978 | Longest Turbulent Subarray | Medium | Solution |
979 | Distribute Coins in Binary Tree | Medium | Solution |
980 | Unique Paths III | Hard | Solution |
983 | Minimum Cost For Tickets | Medium | Solution |
984 | String Without AAA or BBB | Medium | Solution |
985 | Sum of Even Numbers After Queries | Easy | Solution |
986 | Interval List Intersections | Medium | Solution |
987 | Vertical Order Traversal of a Binary Tree | Medium | Solution |
989 | Add to Array-Form of Integer | Easy | Solution |
990 | Satisfiability of Equality Equations | Medium | Solution |
992 | Subarrays with K Different Integers | Hard | Solution |
993 | Cousins in Binary Tree | Easy | Solution |
994 | Rotting Oranges | Medium | Solution |
996 | Number of Squareful Arrays | Hard | Solution |
997 | Find the Town Judge | Easy | Solution |
998 | Maximum Binary Tree II | Medium | Solution |
999 | Available Captures for Rook | Easy | Solution |
1000 | Minimum Cost to Merge Stones | Hard | Solution |
1002 | Find Common Characters | Easy | Solution |
1003 | Check If Word Is Valid After Substitutions | Medium | Solution |
1004 | Max Consecutive Ones III | Medium | Solution |
1005 | Maximize Sum Of Array After K Negations | Easy | Solution |
1008 | Construct Binary Search Tree from Preorder Traversal | Medium | Solution |
1010 | Pairs of Songs With Total Durations Divisible by 60 | Medium | Solution |
1011 | Capacity To Ship Packages Within D Days | Medium | Solution |
1012 | Complement of Base 10 Integer | Easy | Solution |
1013 | Partition Array Into Three Parts With Equal Sum | Easy | Solution |
1014 | Best Sightseeing Pair | Medium | Solution |
1016 | Binary String With Substrings Representing 1 To N | Medium | Solution |
1017 | Convert to Base -2 | Medium | Solution |
1018 | Binary Prefix Divisible By 5 | Easy | Solution |
1019 | Next Greater Node In Linked List | Medium | Solution |
1020 | Number of Enclaves | Medium | Solution |
1021 | Remove Outermost Parentheses | Easy | Solution |
1022 | Sum of Root To Leaf Binary Numbers | Easy | Solution |
1023 | Camelcase Matching | Medium | Solution |
1025 | Divisor Game | Easy | Solution |
1026 | Maximum Difference Between Node and Ancestor | Medium | Solution |
1027 | Longest Arithmetic Sequence | Medium | Solution |
1028 | Recover a Tree From Preorder Traversal | Hard | Solution |
1029 | Two City Scheduling | Easy | Solution |
1030 | Matrix Cells in Distance Order | Easy | Solution |
1031 | Maximum Sum of Two Non-Overlapping Subarrays | Medium | Solution |
1032 | Stream of Characters | Hard | Solution |
1033 | Moving Stones Until Consecutive | Easy | Solution |
1034 | Coloring A Border | Medium | Solution |
1035 | Uncrossed Lines | Medium | Solution |
1037 | Valid Boomerang | Easy | Solution |
1038 | Binary Search Tree to Greater Sum Tree | Medium | Solution |
1039 | Minimum Score Triangulation of Polygon | Medium | Solution |
1041 | Robot Bounded In Circle | Medium | Solution |
1042 | Flower Planting With No Adjacent | Easy | Solution |
1043 | Partition Array for Maximum Sum | Medium | Solution |
1044 | Longest Duplicate Substring | Hard | Solution |
1046 | Last Stone Weight | Easy | Solution |
1047 | Remove All Adjacent Duplicates In String | Easy | Solution |
1048 | Longest String Chain | Medium | Solution |
1051 | Height Checker | Easy | Solution |
1052 | Grumpy Bookstore Owner | Medium | Solution |
1053 | Previous Permutation With One Swap | Medium | Solution |
1054 | Distant Barcodes | Medium | Solution |
1071 | Greatest Common Divisor of Strings | Easy | Solution |
1072 | Flip Columns For Maximum Number of Equal Rows | Medium | Solution |
1073 | Adding Two Negabinary Numbers | Medium | Solution |
1074 | Number of Submatrices That Sum to Target | Hard | Solution |
1078 | Occurrences After Bigram | Easy | Solution |
1079 | Letter Tile Possibilities | Medium | Solution |
1080 | Insufficient Nodes in Root to Leaf Paths | Medium | Solution |
1081 | Smallest Subsequence of Distinct Characters | Medium | Solution |
1089 | Duplicate Zeros | Easy | Solution |
1090 | Largest Values From Labels | Medium | Solution |
1092 | Shortest Common Supersequence | Hard | Solution |
1094 | Car Pooling | Medium | Solution |
1096 | Brace Expansion II | Hard | Solution |
1103 | Distribute Candies to People | Easy | Solution |
1104 | Path In Zigzag Labelled Binary Tree | Medium | Solution |
1105 | Filling Bookcase Shelves | Medium | Solution |
1106 | Parsing A Boolean Expression | Hard | Solution |
1108 | Defanging an IP Address | Easy | Solution |
1109 | Corporate Flight Bookings | Medium | Solution |
1110 | Delete Nodes And Return Forest | Medium | Solution |
1111 | Maximum Nesting Depth of Two Valid Parentheses Strings | Medium | Solution |
1122 | Relative Sort Array | Easy | Solution |
1123 | Lowest Common Ancestor of Deepest Leaves | Medium | Solution |
1125 | Smallest Sufficient Team | Hard | Solution |
1128 | Number of Equivalent Domino Pairs | Easy | Solution |
1130 | Minimum Cost Tree From Leaf Values | Medium | Solution |
1137 | N-th Tribonacci Number | Easy | Solution |
1139 | Largest 1-Bordered Square | Medium | Solution |
1140 | Stone Game II | Medium | Solution |
1143 | Longest Common Subsequence | Medium | Solution |
1146 | Snapshot Array | Medium | Solution |
1154 | Day of the Year | Easy | Solution |
1155 | Number of Dice Rolls With Target Sum | Medium | Solution |
1160 | Find Words That Can Be Formed by Characters | Easy | Solution |
1161 | Maximum Level Sum of a Binary Tree | Medium | Solution |
1162 | As Far from Land as Possible | Medium | Solution |
1163 | Last Substring in Lexicographical Order | Hard | Solution |
1169 | Invalid Transactions | Medium | Solution |
1170 | Compare Strings by Frequency of the Smallest Character | Easy | Solution |
1175 | Prime Arrangements | Easy | Solution |
1184 | Distance Between Bus Stops | Easy | Solution |
1185 | Day of the Week | Easy | Solution |
1186 | Maximum Subarray Sum with One Deletion | Medium | Solution |
1187 | Make Array Strictly Increasing | Hard | Solution |
1189 | Maximum Number of Balloons | Easy | Solution |
1190 | Reverse Substrings Between Each Pair of Parentheses | Medium | Solution |
1200 | Minimum Absolute Difference | Easy | Solution |
1202 | Smallest String With Swaps | Medium | Solution |
1203 | Sort Items by Groups Respecting Dependencies | Hard | Solution |
1207 | Unique Number of Occurrences | Easy | Solution |
1209 | Remove All Adjacent Duplicates in String II | Medium | Solution |
1210 | Minimum Moves to Reach Target with Rotations | Hard | Solution |
1217 | Minimum Cost to Move Chips to The Same Position | Easy | Solution |
1219 | Path with Maximum Gold | Medium | Solution |
1220 | Count Vowels Permutation | Hard | Solution |
1221 | Split a String in Balanced Strings | Easy | Solution |
1222 | Queens That Can Attack the King | Medium | Solution |
1223 | Dice Roll Simulation | Medium | Solution |
1226 | The Dining Philosophers | Medium | Solution |
1232 | Check If It Is a Straight Line | Easy | Solution |
1233 | Remove Sub-Folders from the Filesystem | Medium | Solution |
1234 | Replace the Substring for Balanced String | Medium | Solution |
1235 | Maximum Profit in Job Scheduling | Hard | Solution |
1237 | Find Positive Integer Solution for a Given Equation | Easy | Solution |
1238 | Circular Permutation in Binary Representation | Medium | Solution |
1248 | Count Number of Nice Subarrays | Medium | Solution |
1249 | Minimum Remove to Make Valid Parentheses | Medium | Solution |
1252 | Cells with Odd Values in a Matrix | Easy | Solution |
1253 | Reconstruct a 2-Row Binary Matrix | Medium | Solution |
1254 | Number of Closed Islands | Medium | Solution |
1260 | Shift 2D Grid | Easy | Solution |
1261 | Find Elements in a Contaminated Binary Tree | Medium | Solution |
1262 | Greatest Sum Divisible by Three | Medium | Solution |
1263 | Minimum Moves to Move a Box to Their Target Location | Hard | Solution |
1266 | Minimum Time Visiting All Points | Easy | Solution |
1267 | Count Servers that Communicate | Medium | Solution |
1268 | Search Suggestions System | Medium | Solution |
1269 | Number of Ways to Stay in the Same Place After Some Steps | Hard | Solution |
1275 | Find Winner on a Tic Tac Toe Game | Easy | Solution |
1277 | Count Square Submatrices with All Ones | Medium | Solution |
1278 | Palindrome Partitioning III | Hard | Solution |
1281 | Subtract the Product and Sum of Digits of an Integer | Easy | Solution |
1282 | Group the People Given the Group Size They Belong To | Medium | Solution |
1283 | Find the Smallest Divisor Given a Threshold | Medium | Solution |
1284 | Minimum Number of Flips to Convert Binary Matrix to Zero Matrix | Hard | Solution |
1286 | Iterator for Combination | Medium | Solution |
1287 | Element Appearing More Than 25% In Sorted Array | Easy | Solution |
1288 | Remove Covered Intervals | Medium | Solution |
1289 | Minimum Falling Path Sum II | Hard | Solution |
1290 | Convert Binary Number in a Linked List to Integer | Easy | Solution |
1291 | Sequential Digits | Medium | Solution |
1292 | Maximum Side Length of a Square with Sum Less than or Equal to Threshold | Medium | Solution |
1293 | Shortest Path in a Grid with Obstacles Elimination | Hard | Solution |
1295 | Find Numbers with Even Number of Digits | Easy | Solution |
1296 | Divide Array in Sets of K Consecutive Numbers | Medium | Solution |
1298 | Maximum Candies You Can Get from Boxes | Hard | Solution |
1299 | Replace Elements with Greatest Element on Right Side | Easy | Solution |
1300 | Sum of Mutated Array Closest to Target | Medium | Solution |
1301 | Number of Paths with Max Score | Hard | Solution |
1302 | Deepest Leaves Sum | Medium | Solution |
1304 | Find N Unique Integers Sum up to Zero | Easy | Solution |
1305 | All Elements in Two Binary Search Trees | Medium | Solution |
1306 | Jump Game III | Medium | Solution |
1307 | Verbal Arithmetic Puzzle | Hard | Solution |
1309 | Decrypt String from Alphabet to Integer Mapping | Easy | Solution |
1310 | XOR Queries of a Subarray | Medium | Solution |
1311 | Get Watched Videos by Your Friends | Medium | Solution |
1312 | Minimum Insertion Steps to Make a String Palindrome | Hard | Solution |
1313 | Decompress Run-Length Encoded List | Easy | Solution |
1314 | Matrix Block Sum | Medium | Solution |
1315 | Sum of Nodes with Even-Valued Grandparent | Medium | Solution |
1316 | Distinct Echo Substrings | Hard | Solution |
1317 | Convert Integer to the Sum of Two No-Zero Integers | Easy | Solution |
1318 | Minimum Flips to Make a OR b Equal to c | Medium | Solution |
1319 | Number of Operations to Make Network Connected | Medium | Solution |
1320 | Minimum Distance to Type a Word Using Two Fingers | Hard | Solution |
1323 | Maximum 69 Number | Easy | Solution |
1324 | Print Words Vertically | Medium | Solution |
1325 | Delete Leaves With a Given Value | Medium | Solution |
1326 | Minimum Number of Taps to Open to Water a Garden | Hard | Solution |
1328 | Break a Palindrome | Medium | Solution |
1329 | Sort the Matrix Diagonally | Medium | Solution |
1330 | Reverse Subarray To Maximize Array Value | Hard | Solution |
1331 | Rank Transform of an Array | Easy | Solution |
1332 | Remove Palindromic Subsequences | Easy | Solution |
1333 | Filter Restaurants by Vegan-Friendly, Price and Distance | Medium | Solution |
1334 | Find the City With the Smallest Number of Neighbors at a Threshold Distance | Medium | Solution |
1335 | Minimum Difficulty of a Job Schedule | Hard | Solution |
1338 | Reduce Array Size to The Half | Medium | Solution |
1339 | Maximum Product of Splitted Binary Tree | Medium | Solution |
1340 | Jump Game V | Hard | Solution |
1341 | The K Weakest Rows in a Matrix | Easy | Solution |
1342 | Number of Steps to Reduce a Number to Zero | Easy | Solution |
1343 | Number of Sub-arrays of Size K and Average Greater than or Equal to Threshold | Medium | Solution |
1344 | Angle Between Hands of a Clock | Medium | Solution |
1345 | Jump Game IV | Hard | Solution |
1346 | Check If N and Its Double Exist | Easy | Solution |
1347 | Minimum Number of Steps to Make Two Strings Anagram | Medium | Solution |
1348 | Tweet Counts Per Frequency | Medium | Solution |
1349 | Maximum Students Taking Exam | Hard | Solution |
1351 | Count Negative Numbers in a Sorted Matrix | Easy | Solution |
1352 | Product of the Last K Numbers | Medium | Solution |
1353 | Maximum Number of Events That Can Be Attended | Medium | Solution |
1354 | Construct Target Array With Multiple Sums | Hard | Solution |
1356 | Sort Integers by The Number of 1 Bits | Easy | Solution |
1357 | Apply Discount Every n Orders | Medium | Solution |
1358 | Number of Substrings Containing All Three Characters | Medium | Solution |
1359 | Count All Valid Pickup and Delivery Options | Hard | Solution |
1360 | Number of Days Between Two Dates | Easy | Solution |
1361 | Validate Binary Tree Nodes | Medium | Solution |
1363 | Largest Multiple of Three | Hard | Solution |
1367 | Linked List in Binary Tree | Medium | Solution |
1368 | Minimum Cost to Make at Least One Valid Path in a Grid | Hard | Solution |
1370 | Increasing Decreasing String | Easy | Solution |
1371 | Find the Longest Substring Containing Vowels in Even Counts | Medium | Solution |
1372 | Longest ZigZag Path in a Binary Tree | Medium | Solution |
1373 | Maximum Sum BST in Binary Tree | Hard | Solution |
1374 | Generate a String With Characters That Have Odd Counts | Easy | Solution |
1375 | Bulb Switcher III | Medium | Solution |
1376 | Time Needed to Inform All Employees | Medium | Solution |
1377 | Frog Position After T Seconds | Hard | Solution |
1379 | Find a Corresponding Node of a Binary Tree in a Clone of That Tree | Medium | Solution |
1380 | Lucky Numbers in a Matrix | Easy | Solution |
1381 | Design a Stack With Increment Operation | Medium | Solution |
1382 | Balance a Binary Search Tree | Medium | Solution |
1383 | Maximum Performance of a Team | Hard | Solution |
1385 | Find the Distance Value Between Two Arrays | Easy | Solution |
1386 | Cinema Seat Allocation | Medium | Solution |
1387 | Sort Integers by The Power Value | Medium | Solution |
1388 | Pizza With 3n Slices | Hard | Solution |
1389 | Create Target Array in the Given Order | Easy | Solution |
1390 | Four Divisors | Medium | Solution |
1391 | Check if There is a Valid Path in a Grid | Medium | Solution |
1392 | Longest Happy Prefix | Hard | Solution |
1397 | Find All Good Strings | Hard | Solution |
1399 | Count Largest Group | Easy | Solution |
1400 | Construct K Palindrome Strings | Medium | Solution |
1401 | Circle and Rectangle Overlapping | Medium | Solution |
1402 | Reducing Dishes | Hard | Solution |
1403 | Minimum Subsequence in Non-Increasing Order | Easy | Solution |
1404 | Number of Steps to Reduce a Number in Binary Representation to One | Medium | Solution |
1405 | Longest Happy String | Medium | Solution |
1406 | Stone Game III | Hard | Solution |
1408 | String Matching in an Array | Easy | Solution |
1409 | Queries on a Permutation With Key | Medium | Solution |
1410 | HTML Entity Parser | Medium | Solution |
1411 | Number of Ways to Paint N × 3 Grid | Hard | Solution |
1413 | Minimum Value to Get Positive Step by Step Sum | Easy | Solution |
1414 | Find the Minimum Number of Fibonacci Numbers Whose Sum Is K | Medium | Solution |
1415 | The k-th Lexicographical String of All Happy Strings of Length n | Medium | Solution |
1416 | Restore The Array | Hard | Solution |
1419 | Minimum Number of Frogs Croaking | Medium | Solution |
1420 | Build Array Where You Can Find The Maximum Exactly K Comparisons | Hard | Solution |
1422 | Maximum Score After Splitting a String | Easy | Solution |
1423 | Maximum Points You Can Obtain from Cards | Medium | Solution |
1424 | Diagonal Traverse II | Medium | Solution |
1425 | Constrained Subsequence Sum | Hard | Solution |
1428 | Leftmost Column with at Least a One | Medium | Solution |
1429 | First Unique Number | Medium | Solution |
1430 | Check If a String Is a Valid Sequence from Root to Leaves Path in a Binary Tree | Medium | Solution |
1434 | Number of Ways to Wear Different Hats to Each Other | Hard | Solution |
1436 | Destination City | Easy | Solution |
1437 | Check If All 1's Are at Least Length K Places Away | Medium | Solution |
1438 | Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit | Medium | Solution |
1439 | Find the Kth Smallest Sum of a Matrix With Sorted Rows | Hard | Solution |
1441 | Build an Array With Stack Operations | Solution | |
1443 | Minimum Time to Collect All Apples in a Tree | Medium | Solution |
1444 | Number of Ways of Cutting a Pizza | Hard | Solution |
1446 | Consecutive Characters | Easy | Solution |
1447 | Simplified Fractions | Medium | Solution |
1448 | Count Good Nodes in Binary Tree | Medium | Solution |
1449 | Form Largest Integer With Digits That Add up to Target | Hard | Solution |
1452 | People Whose List of Favorite Companies Is Not a Subset of Another List | Medium | Solution |
1455 | Check If a Word Occurs As a Prefix of Any Word in a Sentence | Easy | Solution |
1456 | Maximum Number of Vowels in a Substring of Given Length | Medium | Solution |
1457 | Pseudo-Palindromic Paths in a Binary Tree | Medium | Solution |
1458 | Max Dot Product of Two Subsequences | Hard | Solution |
1460 | Make Two Arrays Equal by Reversing Sub-arrays | Easy | Solution |
1461 | Check If a String Contains All Binary Codes of Size K | Medium | Solution |
1462 | Course Schedule IV | Medium | Solution |
1463 | Cherry Pickup II | Hard | Solution |
1464 | Maximum Product of Two Elements in an Array | Easy | Solution |
1467 | Probability of a Two Boxes Having The Same Number of Distinct Balls | Hard | Solution |
1470 | Shuffle the Array | Easy | Solution |
1471 | The k Strongest Values in an Array | Medium | Solution |
1472 | Design Browser History | Medium | Solution |
1473 | Paint House III | Hard | Solution |
1475 | Final Prices With a Special Discount in a Shop | Easy | Solution |
1476 | Subrectangle Queries | Medium | Solution |
1477 | Find Two Non-overlapping Sub-arrays Each With Target Sum | Solution | |
1478 | Allocate Mailboxes | Hard | Solution |
1480 | Running Sum of 1d Array | Easy | Solution |
1481 | Least Number of Unique Integers after K Removals | Medium | Solution |
1482 | Minimum Number of Days to Make m Bouquets | Medium | Solution |
1483 | Kth Ancestor of a Tree Node | Hard | Solution |
1486 | XOR Operation in an Array | Easy | Solution |
1487 | Making File Names Unique | Medium | Solution |
1488 | Avoid Flood in The City | Medium | Solution |
1489 | Find Critical and Pseudo-Critical Edges in Minimum Spanning Tree | Hard | Solution |
1491 | Average Salary Excluding the Minimum and Maximum Salary | Easy | Solution |
1492 | The kth Factor of n | Medium | Solution |
1493 | Longest Subarray of 1's After Deleting One Element | Medium | Solution |
1494 | Parallel Courses II | Hard | Solution |
1496 | Path Crossing | Easy | Solution |
1497 | Check If Array Pairs Are Divisible by k | Medium | Solution |
1498 | Number of Subsequences That Satisfy the Given Sum Condition | Medium | Solution |
1499 | Max Value of Equation | Hard | Solution |
1502 | Can Make Arithmetic Progression From Sequence | Easy | Solution |
1503 | Last Moment Before All Ants Fall Out of a Plank | Medium | Solution |
1504 | Count Submatrices With All Ones | Medium | Solution |
1505 | Minimum Possible Integer After at Most K Adjacent Swaps On Digits | Hard | Solution |
1507 | Reformat Date | Easy | Solution |
1508 | Range Sum of Sorted Subarray Sums | Medium | Solution |
1509 | Minimum Difference Between Largest and Smallest Value in Three Moves | Medium | Solution |
1510 | Stone Game IV | Hard | Solution |
1512 | Number of Good Pairs | Easy | Solution |
1513 | Number of Substrings With Only 1s | Medium | Solution |
1514 | Path with Maximum Probability | Medium | Solution |
1515 | Best Position for a Service Centre | Hard | Solution |
1518 | Water Bottles | Easy | Solution |
1519 | Number of Nodes in the Sub-Tree With the Same Label | Medium | Solution |
1520 | Maximum Number of Non-Overlapping Substrings | Medium | Solution |
1521 | Find a Value of a Mysterious Function Closest to Target | Hard | Solution |
1523 | Count Odd Numbers in an Interval Range | Easy | Solution |
1524 | Number of Sub-arrays With Odd Sum | Medium | Solution |
1525 | Number of Good Ways to Split a String | Medium | Solution |
1526 | Minimum Number of Increments on Subarrays to Form a Target Array | Hard | Solution |
1531 | String Compression II | Hard | Solution |
1534 | Count Good Triplets | Easy | Solution |
1535 | Find the Winner of an Array Game | Medium | Solution |
1536 | Minimum Swaps to Arrange a Binary Grid | Medium | Solution |
1537 | Get the Maximum Score | Hard | Solution |
1539 | Kth Missing Positive Number | Easy | Solution |
1540 | Can Convert String in K Moves | Medium | Solution |
1541 | Minimum Insertions to Balance a Parentheses String | Medium | Solution |
1542 | Find Longest Awesome Substring | Hard | Solution |
1544 | Make The String Great | Easy | Solution |
1545 | Find Kth Bit in Nth Binary String | Medium | Solution |
1546 | Maximum Number of Non-Overlapping Subarrays With Sum Equals Target | Medium | Solution |
1547 | Minimum Cost to Cut a Stick | Hard | Solution |
1550 | Three Consecutive Odds | Easy | Solution |
1551 | Minimum Operations to Make Array Equal | Medium | Solution |
1552 | Magnetic Force Between Two Balls | Medium | Solution |
1553 | Minimum Number of Days to Eat N Oranges | Hard | Solution |
1556 | Thousand Separator | Easy | Solution |
1557 | Minimum Number of Vertices to Reach All Nodes | Medium | Solution |
1558 | Minimum Numbers of Function Calls to Make Target Array | Medium | Solution |
1559 | Detect Cycles in 2D Grid | Solution | |
1560 | Most Visited Sector in a Circular Track | Easy | Solution |
1561 | Maximum Number of Coins You Can Get | Medium | Solution |
1562 | Find Latest Group of Size M | Medium | Solution |
1563 | Stone Game V | Hard | Solution |
1566 | Detect Pattern of Length M Repeated K or More Times | Easy | Solution |
1567 | Maximum Length of Subarray With Positive Product | Medium | Solution |
1568 | Minimum Number of Days to Disconnect Island | Medium | Solution |
1569 | Number of Ways to Reorder Array to Get Same BST | Hard | Solution |
1572 | Matrix Diagonal Sum | Easy | Solution |
1573 | Number of Ways to Split a String | Medium | Solution |
1574 | Shortest Subarray to be Removed to Make Array Sorted | Medium | Solution |
1575 | Count All Possible Routes | Hard | Solution |
1576 | Replace All ?'s to Avoid Consecutive Repeating Characters | Easy | Solution |
1577 | Number of Ways Where Square of Number Is Equal to Product of Two Numbers | Medium | Solution |
1578 | Minimum Deletion Cost to Avoid Repeating Letters | Medium | Solution |
1579 | Remove Max Number of Edges to Keep Graph Fully Traversable | Hard | Solution |
1582 | Special Positions in a Binary Matrix | Easy | Solution |
1583 | Count Unhappy Friends | Medium | Solution |
1584 | Min Cost to Connect All Points | Medium | Solution |
1585 | Check If String Is Transformable With Substring Sort Operations | Hard | Solution |
1588 | Sum of All Odd Length Subarrays | Easy | Solution |
1589 | Maximum Sum Obtained of Any Permutation | Medium | Solution |
1590 | Make Sum Divisible by P | Medium | Solution |
1591 | Strange Printer II | Hard | Solution |
1592 | Rearrange Spaces Between Words | Easy | Solution |
1593 | Split a String Into the Max Number of Unique Substrings | Medium | Solution |
1594 | Maximum Non Negative Product in a Matrix | Medium | Solution |
1595 | Minimum Cost to Connect Two Groups of Points | Hard | Solution |
1598 | Crawler Log Folder | Easy | Solution |
1599 | Maximum Profit of Operating a Centennial Wheel | Medium | Solution |
1600 | Throne Inheritance | Medium | Solution |
1601 | Maximum Number of Achievable Transfer Requests | Hard | Solution |
1603 | Design Parking System | Easy | Solution |
1604 | Alert Using Same Key-Card Three or More Times in a One Hour Period | Medium | Solution |
1605 | Find Valid Matrix Given Row and Column Sums | Medium | Solution |
1606 | Find Servers That Handled Most Number of Requests | Hard | Solution |
1608 | Special Array With X Elements Greater Than or Equal X | Easy | Solution |
1609 | Even Odd Tree | Medium | Solution |
1610 | Maximum Number of Visible Points | Medium | Solution |
1611 | Minimum One Bit Operations to Make Integers Zero | Hard | Solution |
1614 | Maximum Nesting Depth of the Parentheses | Easy | Solution |
1615 | Maximal Network Rank | Medium | Solution |
1616 | Split Two Strings to Make Palindrome | Medium | Solution |
1617 | Count Subtrees With Max Distance Between Cities | Hard | Solution |
1619 | Mean of Array After Removing Some Elements | Easy | Solution |
1620 | Coordinate With Maximum Network Quality | Medium | Solution |
1621 | Number of Sets of K Non-Overlapping Line Segments | Medium | Solution |
1622 | Fancy Sequence | Hard | Solution |
1624 | Largest Substring Between Two Equal Characters | Easy | Solution |
1625 | Lexicographically Smallest String After Applying Operations | Medium | Solution |
1626 | Best Team With No Conflicts | Medium | Solution |
1627 | Graph Connectivity With Threshold | Hard | Solution |
1631 | Path With Minimum Effort | Medium | Solution |
1632 | Rank Transform of a Matrix | Hard | Solution |
1636 | Sort Array by Increasing Frequency | Easy | Solution |
1637 | Widest Vertical Area Between Two Points Containing No Points | Medium | Solution |
1638 | Count Substrings That Differ by One Character | Medium | Solution |
1639 | Number of Ways to Form a Target String Given a Dictionary | Hard | Solution |
1640 | Check Array Formation Through Concatenation | Easy | Solution |
1641 | Count Sorted Vowel Strings | Medium | Solution |
1642 | Furthest Building You Can Reach | Medium | Solution |
1643 | Kth Smallest Instructions | Hard | Solution |
1648 | Sell Diminishing-Valued Colored Balls | Medium | Solution |
1649 | Create Sorted Array through Instructions | Hard | Solution |
1654 | Minimum Jumps to Reach Home | Medium | Solution |
1657 | Determine if Two Strings Are Close | Medium | Solution |
1658 | Minimum Operations to Reduce X to Zero | Medium | Solution |
1659 | Maximize Grid Happiness | Hard | Solution |
1662 | Check If Two String Arrays are Equivalent | Easy | Solution |
1663 | Smallest String With A Given Numeric Value | Medium | Solution |
1664 | Ways to Make a Fair Array | Medium | Solution |
1665 | Minimum Initial Energy to Finish Tasks | Hard | Solution |
1668 | Maximum Repeating Substring | Easy | Solution |
1669 | Merge In Between Linked Lists | Medium | Solution |
1670 | Design Front Middle Back Queue | Medium | Solution |
1671 | Minimum Number of Removals to Make Mountain Array | Hard | Solution |
1672 | Richest Customer Wealth | Easy | Solution |
1673 | Find the Most Competitive Subsequence | Medium | Solution |
1674 | Minimum Moves to Make Array Complementary | Medium | Solution |
1675 | Minimize Deviation in Array | Hard | Solution |
1678 | Goal Parser Interpretation | Easy | Solution |
1679 | Max Number of K-Sum Pairs | Medium | Solution |
1680 | Concatenation of Consecutive Binary Numbers | Medium | Solution |
1681 | Minimum Incompatibility | Hard | Solution |
1687 | Delivering Boxes from Storage to Ports | Hard | Solution |
1688 | Count of Matches in Tournament | Easy | Solution |
1689 | Partitioning Into Minimum Number Of Deci-Binary Numbers | Medium | Solution |
1690 | Stone Game VII | Medium | Solution |
1691 | Maximum Height by Stacking Cuboids | Hard | Solution |
1694 | Reformat Phone Number | Easy | Solution |
1695 | Maximum Erasure Value | Medium | Solution |
1696 | Jump Game VI | Medium | Solution |
1697 | Checking Existence of Edge Length Limited Paths | Hard | Solution |
1700 | Number of Students Unable to Eat Lunch | Easy | Solution |
1701 | Average Waiting Time | Medium | Solution |
1702 | Maximum Binary String After Change | Medium | Solution |
1704 | Determine if String Halves Are Alike | Easy | Solution |
1705 | Maximum Number of Eaten Apples | Medium | Solution |
1706 | Where Will the Ball Fall | Medium | Solution |
1707 | Maximum XOR With an Element From Array | Hard | Solution |
1710 | Maximum Units on a Truck | Easy | Solution |
1711 | Count Good Meals | Medium | Solution |
1712 | Ways to Split Array Into Three Subarrays | Medium | Solution |
1713 | Minimum Operations to Make a Subsequence | Hard | Solution |
1716 | Calculate Money in Leetcode Bank | Easy | Solution |
1717 | Maximum Score From Removing Substrings | Medium | Solution |
1718 | Construct the Lexicographically Largest Valid Sequence | Medium | Solution |
1719 | Number Of Ways To Reconstruct A Tree | Hard | Solution |
1720 | Decode XORed Array | Easy | Solution |
1721 | Swapping Nodes in a Linked List | Medium | Solution |
1722 | Minimize Hamming Distance After Swap Operations | Medium | Solution |
1723 | Find Minimum Time to Finish All Jobs | Hard | Solution |
1727 | Largest Submatrix With Rearrangements | Medium | Solution |
1732 | Find the Highest Altitude | Easy | Solution |
1733 | Minimum Number of People to Teach | Medium | Solution |
1734 | Decode XORed Permutation | Medium | Solution |
1735 | Count Ways to Make Array With Product | Hard | Solution |
1736 | Latest Time by Replacing Hidden Digits | Easy | Solution |
1737 | Change Minimum Characters to Satisfy One of Three Conditions | Medium | Solution |
1738 | Find Kth Largest XOR Coordinate Value | Medium | Solution |
All rights reserved by github.com/lzl124631x. Contact me if you want to redistribute the code. No commercial use.