| 4 |
Median of Two Sorted Arrays |
Binary Search |
JavaScript, Python |
O(n) |
O(1) |
Explanation |
| 10 |
Regular Expression Matching |
Dynamic Programming |
JavaScript |
O(n) |
O(n) |
Explanation |
| 23 |
Merge k Sorted Lists |
Two Pointers |
JavaScript, Python |
O(n) |
O(1) |
Explanation |
| 25 |
Reverse Nodes in k-Group |
Two Pointers |
JavaScript, Python |
O(n) |
O(1) |
Explanation |
| 30 |
Substring with Concatenation of All Words |
Sliding Window |
Python |
O(n) |
O(1) |
Explanation |
| 32 |
Longest Valid Parentheses |
Stack & Queue |
JavaScript, Python |
O(n) |
O(n) |
Explanation |
| 37 |
Sudoku Solver |
Backtracking |
Python |
O(n) |
O(1) |
Explanation |
| 41 |
First Missing Positive |
Array / General |
JavaScript, Python |
O(n) |
O(1) |
Explanation |
| 42 |
Trapping Rain Water |
Two Pointers |
JavaScript, Python |
O(n) |
O(1) |
Explanation |
| 44 |
Wildcard Matching |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 51 |
N-Queens |
Backtracking |
JavaScript, Python |
O(n) |
O(1) |
Explanation |
| 52 |
N-Queens II |
Backtracking |
Python |
O(n) |
O(1) |
Explanation |
| 60 |
Permutation Sequence |
Backtracking |
Python |
O(n) |
O(1) |
Explanation |
| 65 |
Valid Number |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 68 |
Text Justification |
Heap |
Python |
O(n) |
O(n) |
Explanation |
| 76 |
Minimum Window Substring |
Sliding Window |
JavaScript, PHP |
O(n) |
O(1) |
Explanation |
| 84 |
Largest Rectangle in Histogram |
Monotonic Stack |
JavaScript, TypeScript |
O(n) |
O(n) |
Explanation |
| 85 |
Maximal Rectangle |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 87 |
Scramble String |
Hash Map |
JavaScript |
O(n) |
O(n) |
Explanation |
| 115 |
Distinct Subsequences |
Dynamic Programming |
JavaScript |
O(n) |
O(n) |
Explanation |
| 123 |
Best Time to Buy and Sell Stock III |
Math & Logic |
JavaScript |
O(n) |
O(1) |
Explanation |
| 124 |
Binary Tree Maximum Path Sum |
Binary Search |
JavaScript |
O(n) |
O(1) |
Explanation |
| 126 |
Word Ladder II |
Backtracking |
Python |
O(n) |
O(1) |
Explanation |
| 127 |
Word Ladder |
Hash Map |
JavaScript |
O(n) |
O(n) |
Explanation |
| 132 |
Palindrome Partitioning II |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 135 |
Candy |
Two Pointers |
JavaScript, Python |
O(n) |
O(1) |
Explanation |
| 140 |
Word Break II |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 149 |
Max Points on a Line |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 154 |
Find Minimum in Rotated Sorted Array II |
Binary Search |
C++ |
O(n) |
O(1) |
Explanation |
| 174 |
Dungeon Game |
Dynamic Programming |
JavaScript |
O(n) |
O(n) |
Explanation |
| 185 |
Department Top Three Salaries |
Database / SQL |
SQL |
O(n) |
O(n) |
Explanation |
| 188 |
Best Time to Buy and Sell Stock IV |
Two Pointers |
JavaScript |
O(n) |
O(1) |
Explanation |
| 212 |
Word Search II |
Binary Search |
JavaScript |
O(n) |
O(1) |
Explanation |
| 214 |
Shortest Palindrome |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 218 |
The Skyline Problem |
Hash Map |
JavaScript |
O(n) |
O(n) |
Explanation |
| 220 |
Contains Duplicate III |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 224 |
Basic Calculator |
Stack & Queue |
JavaScript |
O(n) |
O(n) |
Explanation |
| 233 |
Number of Digit One |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 239 |
Sliding Window Maximum |
Sliding Window |
Python |
O(n) |
O(1) |
Explanation |
| 262 |
Trips and Users |
Database / SQL |
SQL |
O(n) |
O(n) |
Explanation |
| 273 |
Integer to English Words |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 282 |
Expression Add Operators |
Tree & Graph |
Python |
O(n) |
O(n) |
Explanation |
| 295 |
Find Median from Data Stream |
Two Pointers |
JavaScript |
O(n) |
O(1) |
Explanation |
| 297 |
Serialize and Deserialize Binary Tree |
Binary Search |
Python |
O(n) |
O(1) |
Explanation |
| 301 |
Remove Invalid Parentheses |
Backtracking |
Python |
O(n) |
O(1) |
Explanation |
| 312 |
Burst Balloons |
Dynamic Programming |
Python |
O(n) |
O(n) |
Explanation |
| 315 |
Count of Smaller Numbers After Self |
Two Pointers |
JavaScript |
O(n) |
O(1) |
Explanation |
| 321 |
Create Maximum Number |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 327 |
Count of Range Sum |
Two Pointers |
JavaScript |
O(n) |
O(1) |
Explanation |
| 329 |
Longest Increasing Path in a Matrix |
Stack & Queue |
Python |
O(n) |
O(n) |
Explanation |
| 330 |
Patching Array |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 332 |
Reconstruct Itinerary |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 335 |
Self Crossing |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 336 |
Palindrome Pairs |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 352 |
Data Stream as Disjoint Intervals |
Heap |
Python |
O(n) |
O(n) |
Explanation |
| 354 |
Russian Doll Envelopes |
Two Pointers |
JavaScript |
O(n) |
O(1) |
Explanation |
| 363 |
Max Sum of Rectangle No Larger Than K |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 381 |
Insert Delete GetRandom O(1) - Duplicates allowed |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 391 |
Perfect Rectangle |
Math & Logic |
Python |
O(n) |
O(1) |
Explanation |
| 403 |
Frog Jump |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 407 |
Trapping Rain Water II |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 410 |
Split Array Largest Sum |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 420 |
Strong Password Checker |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 432 |
All O`one Data Structure |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 440 |
K-th Smallest in Lexicographical Order |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 446 |
Arithmetic Slices II - Subsequence |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 458 |
Poor Pigs |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 460 |
LFU Cache |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 466 |
Count The Repetitions |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 472 |
Concatenated Words |
Dynamic Programming |
Python |
O(n) |
O(n) |
Explanation |
| 479 |
Largest Palindrome Product |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 480 |
Sliding Window Median |
Sliding Window |
Python |
O(n) |
O(1) |
Explanation |
| 483 |
Smallest Good Base |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 488 |
Zuma Game |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 493 |
Reverse Pairs |
Two Pointers |
JavaScript, Python |
O(n) |
O(1) |
Explanation |
| 502 |
IPO |
Two Pointers |
JavaScript |
O(n) |
O(1) |
Explanation |
| 514 |
Freedom Trail |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 517 |
Super Washing Machines |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 546 |
Remove Boxes |
Dynamic Programming |
Python |
O(n) |
O(n) |
Explanation |
| 552 |
Student Attendance Record II |
Dynamic Programming |
Python |
O(n) |
O(n) |
Explanation |
| 564 |
Find the Closest Palindrome |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 587 |
Erect the Fence |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 591 |
Tag Validator |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 600 |
Non-negative Integers without Consecutive Ones |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 601 |
Human Traffic of Stadium |
Database / SQL |
SQL |
O(n) |
O(n) |
Explanation |
| 629 |
K Inverse Pairs Array |
Dynamic Programming |
Python |
O(n) |
O(n) |
Explanation |
| 630 |
Course Schedule III |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 632 |
Smallest Range Covering Elements from K Lists |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 639 |
Decode Ways II |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 664 |
Strange Printer |
Dynamic Programming |
Python |
O(n) |
O(n) |
Explanation |
| 668 |
Kth Smallest Number in Multiplication Table |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 675 |
Cut Off Trees for Golf Event |
Binary Search |
Python |
O(n) |
O(1) |
Explanation |
| 679 |
24 Game |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 685 |
Redundant Connection II |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 689 |
Maximum Sum of 3 Non-Overlapping Subarrays |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 691 |
Stickers to Spell Word |
Two Pointers |
JavaScript |
O(n) |
O(1) |
Explanation |
| 710 |
Random Pick with Blacklist |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 715 |
Range Module |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 719 |
Find K-th Smallest Pair Distance |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 726 |
Number of Atoms |
Hash Map |
JavaScript |
O(n) |
O(n) |
Explanation |
| 730 |
Count Different Palindromic Subsequences |
Dynamic Programming |
Python |
O(n) |
O(n) |
Explanation |
| 732 |
My Calendar III |
Hash Map |
JavaScript |
O(n) |
O(n) |
Explanation |
| 736 |
Parse Lisp Expression |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 741 |
Cherry Pickup |
Dynamic Programming |
JavaScript |
O(n) |
O(n) |
Explanation |
| 745 |
Prefix and Suffix Search |
Prefix Sum |
Python |
O(n) |
O(n) |
Explanation |
| 749 |
Contain Virus |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 753 |
Cracking the Safe |
Two Pointers |
JavaScript |
O(n) |
O(1) |
Explanation |
| 757 |
Set Intersection Size At Least Two |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 761 |
Special Binary String |
Tree & Graph |
Python |
O(n) |
O(n) |
Explanation |
| 765 |
Couples Holding Hands |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 768 |
Max Chunks To Make Sorted II |
Stack & Queue |
Python |
O(n) |
O(n) |
Explanation |
| 770 |
Basic Calculator IV |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 773 |
Sliding Puzzle |
Sliding Window |
Python |
O(n) |
O(1) |
Explanation |
| 778 |
Swim in Rising Water |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 780 |
Reaching Points |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 782 |
Transform to Chessboard |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 793 |
Preimage Size of Factorial Zeroes Function |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 798 |
Smallest Rotation with Highest Score |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 803 |
Bricks Falling When Hit |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 805 |
Split Array With Same Average |
Dynamic Programming |
JavaScript |
O(n) |
O(n) |
Explanation |
| 810 |
Chalkboard XOR Game |
Bit Manipulation |
Python |
O(n) |
O(1) |
Explanation |
| 815 |
Bus Routes |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 818 |
Race Car |
Dynamic Programming |
Python |
O(n) |
O(n) |
Explanation |
| 827 |
Making A Large Island |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 828 |
Count Unique Characters of All Substrings of a Given String |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 829 |
Consecutive Numbers Sum |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 834 |
Sum of Distances in Tree |
Binary Search |
JavaScript |
O(n) |
O(1) |
Explanation |
| 839 |
Similar String Groups |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 843 |
Guess the Word |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 847 |
Shortest Path Visiting All Nodes |
Two Pointers |
JavaScript |
O(n) |
O(1) |
Explanation |
| 850 |
Rectangle Area II |
Math & Logic |
Python |
O(n) |
O(1) |
Explanation |
| 854 |
K-Similar Strings |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 857 |
Minimum Cost to Hire K Workers |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 862 |
Shortest Subarray with Sum at Least K |
Math & Logic |
JavaScript |
O(n) |
O(1) |
Explanation |
| 864 |
Shortest Path to Get All Keys |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 871 |
Minimum Number of Refueling Stops |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 878 |
Nth Magical Number |
Bit Manipulation |
Python |
O(n) |
O(1) |
Explanation |
| 882 |
Reachable Nodes In Subdivided Graph |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 887 |
Super Egg Drop |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 891 |
Sum of Subsequence Widths |
Dynamic Programming |
JavaScript |
O(n) |
O(n) |
Explanation |
| 895 |
Maximum Frequency Stack |
Hash Map |
JavaScript |
O(n) |
O(n) |
Explanation |
| 899 |
Orderly Queue |
Stack & Queue |
Python |
O(n) |
O(n) |
Explanation |
| 902 |
Numbers At Most N Given Digit Set |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 903 |
Valid Permutations for DI Sequence |
Backtracking |
Python |
O(n) |
O(1) |
Explanation |
| 906 |
Super Palindromes |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 913 |
Cat and Mouse |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 920 |
Number of Music Playlists |
Dynamic Programming |
JavaScript |
O(n) |
O(n) |
Explanation |
| 924 |
Minimize Malware Spread |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 928 |
Minimize Malware Spread II |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 936 |
Stamping The Sequence |
Sliding Window |
JavaScript |
O(n) |
O(1) |
Explanation |
| 940 |
Distinct Subsequences II |
Dynamic Programming |
JavaScript |
O(n) |
O(n) |
Explanation |
| 943 |
Find the Shortest Superstring |
Two Pointers |
JavaScript |
O(n) |
O(1) |
Explanation |
| 952 |
Largest Component Size by Common Factor |
Binary Search |
Python |
O(n) |
O(1) |
Explanation |
| 960 |
Delete Columns to Make Sorted III |
Dynamic Programming |
Python |
O(n) |
O(n) |
Explanation |
| 964 |
Least Operators to Express Number |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 968 |
Binary Tree Cameras |
Binary Search |
Python |
O(n) |
O(1) |
Explanation |
| 972 |
Equal Rational Numbers |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 975 |
Odd Even Jump |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 980 |
Unique Paths III |
Binary Search |
JavaScript |
O(n) |
O(1) |
Explanation |
| 982 |
Triples with Bitwise AND Equal To Zero |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 987 |
Vertical Order Traversal of a Binary Tree |
Tree & Graph |
Python |
O(n) |
O(n) |
Explanation |
| 992 |
Subarrays with K Different Integers |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 995 |
Minimum Number of K Consecutive Bit Flips |
Two Pointers |
JavaScript |
O(n) |
O(1) |
Explanation |
| 996 |
Number of Squareful Arrays |
Tree & Graph |
JavaScript |
O(n) |
O(n) |
Explanation |
| 1000 |
Minimum Cost to Merge Stones |
Dynamic Programming |
Python |
O(n) |
O(n) |
Explanation |
| 1001 |
Grid Illumination |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 1028 |
Recover a Tree From Preorder Traversal |
Binary Search |
JavaScript |
O(n) |
O(1) |
Explanation |
| 1032 |
Stream of Characters |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 1036 |
Escape a Large Maze |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 1044 |
Longest Duplicate Substring |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 1074 |
Number of Submatrices That Sum to Target |
Hash Map |
JavaScript |
O(n) |
O(n) |
Explanation |
| 1092 |
Shortest Common Supersequence |
Binary Search |
Python |
O(n) |
O(1) |
Explanation |
| 1095 |
Find in Mountain Array |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 1096 |
Brace Expansion II |
Array / General |
JavaScript |
O(n) |
O(1) |
Explanation |
| 1106 |
Parsing A Boolean Expression |
Stack & Queue |
Python |
O(n) |
O(n) |
Explanation |
| 1125 |
Smallest Sufficient Team |
Hash Map |
JavaScript |
O(n) |
O(n) |
Explanation |
| 1147 |
Longest Chunked Palindrome Decomposition |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 1157 |
Online Majority Element In Subarray |
Hash Map |
JavaScript |
O(n) |
O(n) |
Explanation |
| 1163 |
Last Substring in Lexicographical Order |
Stack & Queue |
Python |
O(n) |
O(n) |
Explanation |
| 1172 |
Dinner Plate Stacks |
Two Pointers |
JavaScript |
O(n) |
O(1) |
Explanation |
| 1178 |
Number of Valid Words for Each Puzzle |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 1187 |
Make Array Strictly Increasing |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 1192 |
Critical Connections in a Network |
Tree & Graph |
JavaScript |
O(n) |
O(n) |
Explanation |
| 1203 |
Sort Items by Groups Respecting Dependencies |
Array / General |
JavaScript |
O(n) |
O(1) |
Explanation |
| 1206 |
Design Skiplist |
Binary Search |
JavaScript |
O(n) |
O(1) |
Explanation |
| 1210 |
Minimum Moves to Reach Target with Rotations |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 1224 |
Maximum Equal Frequency |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 1235 |
Maximum Profit in Job Scheduling |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 1240 |
Tiling a Rectangle with the Fewest Squares |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 1250 |
Check If It Is a Good Array |
Math & Logic |
Python |
O(n) |
O(1) |
Explanation |
| 1255 |
Maximum Score Words Formed by Letters |
Two Pointers |
JavaScript |
O(n) |
O(1) |
Explanation |
| 1263 |
Minimum Moves to Move a Box to Their Target Location |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 1278 |
Palindrome Partitioning III |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 1284 |
Minimum Number of Flips to Convert Binary Matrix to Zero Matrix |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 1289 |
Minimum Falling Path Sum II |
Stack & Queue |
JavaScript |
O(n) |
O(n) |
Explanation |
| 1293 |
Shortest Path in a Grid with Obstacles Elimination |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 1298 |
Maximum Candies You Can Get from Boxes |
Array / General |
JavaScript |
O(n) |
O(1) |
Explanation |
| 1301 |
Number of Paths with Max Score |
Dynamic Programming |
PHP |
O(n) |
O(n) |
Explanation |
| 1307 |
Verbal Arithmetic Puzzle |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 1312 |
Minimum Insertion Steps to Make a String Palindrome |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 1316 |
Distinct Echo Substrings |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 1320 |
Minimum Distance to Type a Word Using Two Fingers |
Dynamic Programming |
Python |
O(n) |
O(n) |
Explanation |
| 1326 |
Minimum Number of Taps to Open to Water a Garden |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 1330 |
Reverse Subarray To Maximize Array Value |
Bit Manipulation |
Python |
O(n) |
O(1) |
Explanation |
| 1340 |
Jump Game V |
Dynamic Programming |
C++ |
O(n) |
O(n) |
Explanation |
| 1345 |
Jump Game IV |
Hash Map |
C++ |
O(n) |
O(n) |
Explanation |
| 1349 |
Maximum Students Taking Exam |
Dynamic Programming |
JavaScript |
O(n) |
O(n) |
Explanation |
| 1354 |
Construct Target Array With Multiple Sums |
Two Pointers |
JavaScript |
O(n) |
O(1) |
Explanation |
| 1359 |
Count All Valid Pickup and Delivery Options |
Stack & Queue |
JavaScript |
O(n) |
O(n) |
Explanation |
| 1363 |
Largest Multiple of Three |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 1368 |
Minimum Cost to Make at Least One Valid Path in a Grid |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 1373 |
Maximum Sum BST in Binary Tree |
Binary Search |
Python |
O(n) |
O(1) |
Explanation |
| 1377 |
Frog Position After T Seconds |
Tree & Graph |
JavaScript |
O(n) |
O(n) |
Explanation |
| 1383 |
Maximum Performance of a Team |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 1388 |
Pizza With 3n Slices |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 1392 |
Longest Happy Prefix |
Prefix Sum |
Python |
O(n) |
O(n) |
Explanation |
| 1397 |
Find All Good Strings |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 1402 |
Reducing Dishes |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 1406 |
Stone Game III |
Dynamic Programming |
PHP |
O(n) |
O(n) |
Explanation |
| 1416 |
Restore The Array |
Dynamic Programming |
Python |
O(n) |
O(n) |
Explanation |
| 1420 |
Build Array Where You Can Find The Maximum Exactly K Comparisons |
Dynamic Programming |
JavaScript |
O(n) |
O(n) |
Explanation |
| 1425 |
Constrained Subsequence Sum |
Dynamic Programming |
JavaScript |
O(n) |
O(n) |
Explanation |
| 1434 |
Number of Ways to Wear Different Hats to Each Other |
Dynamic Programming |
JavaScript |
O(n) |
O(n) |
Explanation |
| 1439 |
Find the Kth Smallest Sum of a Matrix With Sorted Rows |
Stack & Queue |
JavaScript |
O(n) |
O(n) |
Explanation |
| 1444 |
Number of Ways of Cutting a Pizza |
Dynamic Programming |
Python |
O(n) |
O(n) |
Explanation |
| 1453 |
Maximum Number of Darts Inside of a Circular Dartboard |
Math & Logic |
Python |
O(n) |
O(1) |
Explanation |
| 1463 |
Cherry Pickup II |
Dynamic Programming |
JavaScript |
O(n) |
O(n) |
Explanation |
| 1467 |
Probability of a Two Boxes Having The Same Number of Distinct Balls |
Stack & Queue |
JavaScript |
O(n) |
O(n) |
Explanation |
| 1478 |
Allocate Mailboxes |
Tree & Graph |
JavaScript |
O(n) |
O(n) |
Explanation |
| 1483 |
Kth Ancestor of a Tree Node |
Binary Search |
JavaScript |
O(n) |
O(1) |
Explanation |
| 1489 |
Find Critical and Pseudo-Critical Edges in Minimum Spanning Tree |
Binary Search |
Python |
O(n) |
O(1) |
Explanation |
| 1494 |
Parallel Courses II |
Dynamic Programming |
JavaScript |
O(n) |
O(n) |
Explanation |
| 1499 |
Max Value of Equation |
Stack & Queue |
JavaScript |
O(n) |
O(n) |
Explanation |
| 1505 |
Minimum Possible Integer After at Most K Adjacent Swaps On Digits |
Tree & Graph |
JavaScript |
O(n) |
O(n) |
Explanation |
| 1510 |
Stone Game IV |
Dynamic Programming |
TypeScript |
O(n) |
O(n) |
Explanation |
| 1515 |
Best Position for a Service Centre |
Math & Logic |
Python |
O(n) |
O(1) |
Explanation |
| 1520 |
Maximum Number of Non-Overlapping Substrings |
Heap |
JavaScript |
O(n) |
O(n) |
Explanation |
| 1521 |
Find a Value of a Mysterious Function Closest to Target |
Stack & Queue |
Python |
O(n) |
O(n) |
Explanation |
| 1526 |
Minimum Number of Increments on Subarrays to Form a Target Array |
Bit Manipulation |
Python |
O(n) |
O(1) |
Explanation |
| 1531 |
String Compression II |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 1537 |
Get the Maximum Score |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 1542 |
Find Longest Awesome Substring |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 1547 |
Minimum Cost to Cut a Stick |
Array / General |
JavaScript |
O(n) |
O(1) |
Explanation |
| 1553 |
Minimum Number of Days to Eat N Oranges |
Bit Manipulation |
Python |
O(n) |
O(1) |
Explanation |
| 1563 |
Stone Game V |
Prefix Sum |
Java |
O(n) |
O(n) |
Explanation |
| 1568 |
Minimum Number of Days to Disconnect Island |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 1569 |
Number of Ways to Reorder Array to Get Same BST |
Binary Search |
Python |
O(n) |
O(1) |
Explanation |
| 1575 |
Count All Possible Routes |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 1579 |
Remove Max Number of Edges to Keep Graph Fully Traversable |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 1585 |
Check If String Is Transformable With Substring Sort Operations |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 1591 |
Strange Printer II |
Two Pointers |
JavaScript |
O(n) |
O(1) |
Explanation |
| 1595 |
Minimum Cost to Connect Two Groups of Points |
Dynamic Programming |
JavaScript |
O(n) |
O(n) |
Explanation |
| 1601 |
Maximum Number of Achievable Transfer Requests |
Tree & Graph |
Python |
O(n) |
O(n) |
Explanation |
| 1606 |
Find Servers That Handled Most Number of Requests |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 1610 |
Maximum Number of Visible Points |
Math & Logic |
Python |
O(n) |
O(1) |
Explanation |
| 1611 |
Minimum One Bit Operations to Make Integers Zero |
Bit Manipulation |
Python |
O(n) |
O(1) |
Explanation |
| 1617 |
Count Subtrees With Max Distance Between Cities |
Stack & Queue |
JavaScript |
O(n) |
O(n) |
Explanation |
| 1622 |
Fancy Sequence |
Array / General |
JavaScript |
O(n) |
O(1) |
Explanation |
| 1627 |
Graph Connectivity With Threshold |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 1632 |
Rank Transform of a Matrix |
Stack & Queue |
JavaScript |
O(n) |
O(n) |
Explanation |
| 1639 |
Number of Ways to Form a Target String Given a Dictionary |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 1643 |
Kth Smallest Instructions |
Two Pointers |
JavaScript |
O(n) |
O(1) |
Explanation |
| 1649 |
Create Sorted Array through Instructions |
Hash Map |
JavaScript |
O(n) |
O(n) |
Explanation |
| 1655 |
Distribute Repeating Integers |
Hash Map |
JavaScript |
O(n) |
O(n) |
Explanation |
| 1659 |
Maximize Grid Happiness |
Hash Map |
JavaScript |
O(n) |
O(n) |
Explanation |
| 1665 |
Minimum Initial Energy to Finish Tasks |
Binary Search |
C++ |
O(log n) |
O(1) |
Explanation |
| 1671 |
Minimum Number of Removals to Make Mountain Array |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 1675 |
Minimize Deviation in Array |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 1681 |
Minimum Incompatibility |
Sliding Window |
JavaScript |
O(n) |
O(1) |
Explanation |
| 1687 |
Delivering Boxes from Storage to Ports |
Dynamic Programming |
JavaScript |
O(n) |
O(n) |
Explanation |
| 1691 |
Maximum Height by Stacking Cuboids |
Stack & Queue |
JavaScript |
O(n) |
O(n) |
Explanation |
| 1697 |
Checking Existence of Edge Length Limited Paths |
Dynamic Programming |
Python |
O(n) |
O(n) |
Explanation |
| 1703 |
Minimum Adjacent Swaps for K Consecutive Ones |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 1707 |
Maximum XOR With an Element From Array |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 1713 |
Minimum Operations to Make a Subsequence |
Dynamic Programming |
Python |
O(n) |
O(n) |
Explanation |
| 1719 |
Number Of Ways To Reconstruct A Tree |
Hash Map |
JavaScript |
O(n) |
O(n) |
Explanation |
| 1723 |
Find Minimum Time to Finish All Jobs |
Dynamic Programming |
JavaScript |
O(n) |
O(n) |
Explanation |
| 1728 |
Cat and Mouse II |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 1735 |
Count Ways to Make Array With Product |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 1739 |
Building Boxes |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 1745 |
Palindrome Partitioning IV |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 1751 |
Maximum Number of Events That Can Be Attended II |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 1755 |
Closest Subsequence Sum |
Binary Search |
JavaScript |
O(n) |
O(1) |
Explanation |
| 1761 |
Minimum Degree of a Connected Trio in a Graph |
Dynamic Programming |
JavaScript |
O(n) |
O(n) |
Explanation |
| 1766 |
Tree of Coprimes |
Binary Search |
Python |
O(n) |
O(1) |
Explanation |
| 1771 |
Maximize Palindrome Length From Subsequences |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 1776 |
Car Fleet II |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 1782 |
Count Pairs Of Nodes |
Two Pointers |
JavaScript |
O(n) |
O(1) |
Explanation |
| 1787 |
Make the XOR of All Segments Equal to Zero |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 1793 |
Maximum Score of a Good Subarray |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 1799 |
Maximize Score After N Operations |
Hash Map |
JavaScript |
O(n) |
O(n) |
Explanation |
| 1803 |
Count Pairs With XOR in a Range |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 1808 |
Maximize Number of Nice Divisors |
Stack & Queue |
Python |
O(n) |
O(n) |
Explanation |
| 1815 |
Maximum Number of Groups Getting Fresh Donuts |
Hash Map |
JavaScript |
O(n) |
O(n) |
Explanation |
| 1819 |
Number of Different Subsequences GCDs |
Dynamic Programming |
Python |
O(n) |
O(n) |
Explanation |
| 1825 |
Finding MK Average |
Sliding Window |
Python |
O(n) |
O(1) |
Explanation |
| 1830 |
Minimum Number of Operations to Make String Sorted |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 1835 |
Find XOR Sum of All Pairs Bitwise AND |
Bit Manipulation |
Python |
O(n) |
O(1) |
Explanation |
| 1840 |
Maximum Building Height |
Tree & Graph |
Python |
O(n) |
O(n) |
Explanation |
| 1847 |
Closest Room |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 1851 |
Minimum Interval to Include Each Query |
Heap |
Python |
O(n) |
O(n) |
Explanation |
| 1857 |
Largest Color Value in a Directed Graph |
Dynamic Programming |
JavaScript |
O(n) |
O(n) |
Explanation |
| 1862 |
Sum of Floored Pairs |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 1866 |
Number of Ways to Rearrange Sticks With K Sticks Visible |
Dynamic Programming |
Python |
O(n) |
O(n) |
Explanation |
| 1872 |
Stone Game VIII |
Prefix Sum |
Java |
O(n) |
O(n) |
Explanation |
| 1879 |
Minimum XOR Sum of Two Arrays |
Dynamic Programming |
JavaScript |
O(n) |
O(n) |
Explanation |
| 1889 |
Minimum Space Wasted From Packaging |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 1896 |
Minimum Cost to Change the Final Value of Expression |
Two Pointers |
C++ |
O(n) |
O(1) |
Explanation |
| 1900 |
The Earliest and Latest Rounds Where Players Compete |
Dynamic Programming |
Python |
O(n) |
O(n) |
Explanation |
| 1912 |
Design Movie Rental System |
Hash Map |
JavaScript |
O(n) |
O(n) |
Explanation |
| 1916 |
Count Ways to Build Rooms in an Ant Colony |
Stack & Queue |
JavaScript |
O(n) |
O(n) |
Explanation |
| 1923 |
Longest Common Subpath |
Tree & Graph |
Python |
O(n) |
O(n) |
Explanation |
| 1928 |
Minimum Cost to Reach Destination in Time |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 1932 |
Merge BSTs to Create Single BST |
Binary Search |
Python |
O(n) |
O(1) |
Explanation |
| 1938 |
Maximum Genetic Difference Query |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 1944 |
Number of Visible People in a Queue |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 1948 |
Delete Duplicate Folders in System |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 1960 |
Maximum Product of the Length of Two Palindromic Substrings |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 1964 |
Find the Longest Valid Obstacle Course at Each Position |
Two Pointers |
JavaScript |
O(n) |
O(1) |
Explanation |
| 1970 |
Last Day Where You Can Still Cross |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 1977 |
Number of Ways to Separate Numbers |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 1982 |
Find Array Given Subset Sums |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 1987 |
Number of Unique Good Subsequences |
Dynamic Programming |
Python |
O(n) |
O(n) |
Explanation |
| 1994 |
The Number of Good Subsets |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 1998 |
GCD Sort of an Array |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 2003 |
Smallest Missing Genetic Value in Each Subtree |
Prefix Sum |
Python |
O(n) |
O(n) |
Explanation |
| 2009 |
Minimum Number of Operations to Make Array Continuous |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 2014 |
Longest Subsequence Repeated k Times |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 2019 |
The Score of Students Solving Math Expression |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 2025 |
Maximum Number of Ways to Partition an Array |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 2030 |
Smallest K-Length Subsequence With Occurrences of a Letter |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 2035 |
Partition Array Into Two Arrays to Minimize Sum Difference |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 2040 |
Kth Smallest Product of Two Sorted Arrays |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 2045 |
Second Minimum Time to Reach Destination |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 2050 |
Parallel Courses III |
Two Pointers |
JavaScript |
O(n) |
O(1) |
Explanation |
| 2056 |
Number of Valid Move Combinations On Chessboard |
Backtracking |
Python |
O(n) |
O(1) |
Explanation |
| 2065 |
Maximum Path Quality of a Graph |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 2071 |
Maximum Number of Tasks You Can Assign |
Math & Logic |
JavaScript |
O(n) |
O(1) |
Explanation |
| 2076 |
Process Restricted Friend Requests |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 2081 |
Sum of k-Mirror Numbers |
Two Pointers |
C++ |
O(n) |
O(1) |
Explanation |
| 2088 |
Count Fertile Pyramids in a Land |
Dynamic Programming |
Python |
O(n) |
O(n) |
Explanation |
| 2092 |
Find All People With Secret |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 2097 |
Valid Arrangement of Pairs |
Hash Map |
JavaScript |
O(n) |
O(n) |
Explanation |
| 2102 |
Sequentially Ordinal Rank Tracker |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 2106 |
Maximum Fruits Harvested After at Most K Steps |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 2111 |
Minimum Operations to Make the Array K-Increasing |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 2117 |
Abbreviating the Product of a Range |
Bit Manipulation |
Python |
O(n) |
O(1) |
Explanation |
| 2122 |
Recover the Original Array |
Binary Search |
Python |
O(n) |
O(1) |
Explanation |
| 2127 |
Maximum Employees to Be Invited to a Meeting |
Two Pointers |
JavaScript |
O(n) |
O(1) |
Explanation |
| 2132 |
Stamping the Grid |
Prefix Sum |
Python |
O(n) |
O(n) |
Explanation |
| 2136 |
Earliest Possible Day of Full Bloom |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 2141 |
Maximum Running Time of N Computers |
Tree & Graph |
Python |
O(n) |
O(n) |
Explanation |
| 2151 |
Maximum Good People Based on Statements |
Stack & Queue |
Python |
O(n) |
O(n) |
Explanation |
| 2156 |
Find Substring With Given Hash Value |
Sliding Window |
Python |
O(n) |
O(1) |
Explanation |
| 2157 |
Groups of Strings |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 2172 |
Maximum AND Sum of Array |
Dynamic Programming |
Python |
O(n) |
O(n) |
Explanation |
| 2179 |
Count Good Triplets in an Array |
Prefix Sum |
JavaScript |
O(n) |
O(n) |
Explanation |
| 2183 |
Count Array Pairs Divisible by K |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 2193 |
Minimum Number of Moves to Make Palindrome |
Two Pointers |
JavaScript |
O(n) |
O(1) |
Explanation |
| 2197 |
Replace Non-Coprime Numbers in Array |
Bit Manipulation |
Python |
O(n) |
O(1) |
Explanation |
| 2203 |
Minimum Weighted Subgraph With the Required Paths |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 2209 |
Minimum White Tiles After Covering With Carpets |
Dynamic Programming |
JavaScript |
O(n) |
O(n) |
Explanation |
| 2213 |
Longest Substring of One Repeating Character |
Binary Search |
Java |
O(n) |
O(1) |
Explanation |
| 2218 |
Maximum Value of K Coins From Piles |
Dynamic Programming |
JavaScript |
O(n) |
O(n) |
Explanation |
| 2223 |
Sum of Scores of Built Strings |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 2227 |
Encrypt and Decrypt Strings |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 2234 |
Maximum Total Beauty of the Gardens |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 2242 |
Maximum Score of a Node Sequence |
Two Pointers |
JavaScript |
O(n) |
O(1) |
Explanation |
| 2246 |
Longest Path With Different Adjacent Characters |
Stack & Queue |
JavaScript |
O(n) |
O(n) |
Explanation |
| 2251 |
Number of Flowers in Full Bloom |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 2258 |
Escape the Spreading Fire |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 2267 |
Check if There Is a Valid Parentheses String Path |
Two Pointers |
C++ |
O(n) |
O(1) |
Explanation |
| 2272 |
Substring With Largest Variance |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 2276 |
Count Integers in Intervals |
Heap |
JavaScript |
O(n) |
O(n) |
Explanation |
| 2281 |
Sum of Total Strength of Wizards |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 2286 |
Booking Concert Tickets in Groups |
Two Pointers |
JavaScript |
O(n) |
O(1) |
Explanation |
| 2290 |
Minimum Obstacle Removal to Reach Corner |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 2296 |
Design a Text Editor |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 2302 |
Count Subarrays With Score Less Than K |
Sliding Window |
Python |
O(n) |
O(1) |
Explanation |
| 2306 |
Naming a Company |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 2312 |
Selling Pieces of Wood |
Dynamic Programming |
Python |
O(n) |
O(n) |
Explanation |
| 2318 |
Number of Distinct Roll Sequences |
Dynamic Programming |
Python |
O(n) |
O(n) |
Explanation |
| 2322 |
Minimum Score After Removals on a Tree |
Stack & Queue |
Java |
O(n) |
O(n) |
Explanation |
| 2328 |
Number of Increasing Paths in a Grid |
Two Pointers |
JavaScript |
O(n) |
O(1) |
Explanation |
| 2334 |
Subarray With Elements Greater Than Varying Threshold |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 2338 |
Count the Number of Ideal Arrays |
Bit Manipulation |
Python |
O(n) |
O(1) |
Explanation |
| 2344 |
Minimum Deletions to Make Array Divisible |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 2350 |
Shortest Impossible Sequence of Rolls |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 2354 |
Number of Excellent Pairs |
Two Pointers |
C++ |
O(n) |
O(1) |
Explanation |
| 2360 |
Longest Cycle in a Graph |
Fast & Slow Pointers |
JavaScript |
O(n) |
O(1) |
Explanation |
| 2366 |
Minimum Replacements to Sort the Array |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 2382 |
Maximum Segment Sum After Removals |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 2386 |
Find the K-Sum of an Array |
Array / General |
JavaScript |
O(n) |
O(1) |
Explanation |
| 2392 |
Build a Matrix With Conditions |
Stack & Queue |
JavaScript |
O(n) |
O(n) |
Explanation |
| 2398 |
Maximum Number of Robots Within Budget |
Math & Logic |
JavaScript |
O(n) |
O(1) |
Explanation |
| 2402 |
Meeting Rooms III |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 2407 |
Longest Increasing Subsequence II |
Two Pointers |
JavaScript |
O(n) |
O(1) |
Explanation |
| 2412 |
Minimum Money Required Before Transactions |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 2416 |
Sum of Prefix Scores of Strings |
Prefix Sum |
Python |
O(n) |
O(n) |
Explanation |
| 2421 |
Number of Good Paths |
Dynamic Programming |
Python |
O(n) |
O(n) |
Explanation |
| 2426 |
Number of Pairs Satisfying Inequality |
Two Pointers |
JavaScript |
O(n) |
O(1) |
Explanation |
| 2430 |
Maximum Deletions on a String |
Dynamic Programming |
Python |
O(n) |
O(n) |
Explanation |
| 2435 |
Paths in Matrix Whose Sum Is Divisible by K |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 2440 |
Create Components With Same Value |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 2444 |
Count Subarrays With Fixed Bounds |
Math & Logic |
JavaScript |
O(n) |
O(1) |
Explanation |
| 2448 |
Minimum Cost to Make Array Equal |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 2449 |
Minimum Number of Operations to Make Arrays Similar |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 2454 |
Next Greater Element IV |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 2458 |
Height of Binary Tree After Subtree Removal Queries |
Binary Search |
Python |
O(n) |
O(1) |
Explanation |
| 2463 |
Minimum Total Distance Traveled |
Array / General |
JavaScript |
O(n) |
O(1) |
Explanation |
| 2468 |
Split Message Based on Limit |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 2472 |
Maximum Number of Non-overlapping Palindrome Substrings |
Two Pointers |
JavaScript |
O(n) |
O(1) |
Explanation |
| 2478 |
Number of Beautiful Partitions |
Array / General |
JavaScript |
O(n) |
O(1) |
Explanation |
| 2488 |
Count Subarrays With Median K |
Hash Map |
JavaScript |
O(n) |
O(n) |
Explanation |
| 2493 |
Divide Nodes Into the Maximum Number of Groups |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 2499 |
Minimum Total Cost to Make Arrays Unequal |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 2503 |
Maximum Number of Points From Grid Queries |
Stack & Queue |
Python |
O(n) |
O(n) |
Explanation |
| 2508 |
Add Edges to Make Degrees of All Nodes Even |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 2509 |
Cycle Length Queries in a Tree |
Fast & Slow Pointers |
JavaScript |
O(n) |
O(1) |
Explanation |
| 2514 |
Count Anagrams |
Hash Map |
JavaScript |
O(n) |
O(n) |
Explanation |
| 2528 |
Maximize the Minimum Powered City |
Prefix Sum |
JavaScript |
O(n) |
O(n) |
Explanation |
| 2532 |
Time to Cross a Bridge |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 2543 |
Check if Point Is Reachable |
Math & Logic |
Python |
O(n) |
O(1) |
Explanation |
| 2547 |
Minimum Cost to Split an Array |
Dynamic Programming |
Python |
O(n) |
O(n) |
Explanation |
| 2551 |
Put Marbles in Bags |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 2552 |
Count Increasing Quadruplets |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 2561 |
Rearranging Fruits |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 2565 |
Subsequence With the Minimum Score |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 2573 |
Find the String with LCP |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 2577 |
Minimum Time to Visit a Cell In a Grid |
Stack & Queue |
JavaScript |
O(n) |
O(n) |
Explanation |
| 2584 |
Split the Array to Make Coprime Products |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 2589 |
Minimum Time to Complete All Tasks |
Two Pointers |
C++ |
O(n) |
O(1) |
Explanation |
| 2603 |
Collect Coins in a Tree |
Stack & Queue |
JavaScript |
O(n) |
O(n) |
Explanation |
| 2608 |
Shortest Cycle in a Graph |
Fast & Slow Pointers |
JavaScript |
O(n) |
O(1) |
Explanation |
| 2612 |
Minimum Reverse Operations |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 2617 |
Minimum Number of Visited Cells in a Grid |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 2630 |
Memoize II |
Hash Map |
TypeScript |
O(n) |
O(n) |
Explanation |
| 2642 |
Design Graph With Shortest Path Calculator |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 2646 |
Minimize the Total Price of the Trips |
Dynamic Programming |
JavaScript |
O(n) |
O(n) |
Explanation |
| 2650 |
Design Cancellable Function |
Array / General |
TypeScript |
O(n) |
O(1) |
Explanation |
| 2659 |
Make Array Empty |
Hash Map |
JavaScript |
O(n) |
O(n) |
Explanation |
| 2663 |
Lexicographically Smallest Beautiful String |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 2681 |
Power of Heroes |
Array / General |
JavaScript |
O(n) |
O(1) |
Explanation |
| 2699 |
Modify Graph Edge Weights |
Array / General |
JavaScript |
O(n) |
O(1) |
Explanation |
| 2709 |
Greatest Common Divisor Traversal |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 2713 |
Maximum Strictly Increasing Cells in a Matrix |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 2732 |
Find a Good Subset of the Matrix |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 2736 |
Maximum Sum Queries |
Two Pointers |
JavaScript |
O(n) |
O(1) |
Explanation |
| 2751 |
Robot Collisions |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 2763 |
Sum of Imbalance Numbers of All Subarrays |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 2781 |
Length of the Longest Valid Substring |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 2790 |
Maximum Number of Groups With Increasing Length |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 2791 |
Count Paths That Can Form a Palindrome in a Tree |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 2813 |
Maximum Elegance of a K-Length Subsequence |
Dynamic Programming |
Python |
O(n) |
O(n) |
Explanation |
| 2818 |
Apply Operations to Maximize Score |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 2835 |
Minimum Operations to Form Subsequence With Target Sum |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 2836 |
Maximize Value of Function in a Ball Passing Game |
Stack & Queue |
Python |
O(n) |
O(n) |
Explanation |
| 2842 |
Count K-Subsequences of a String With Maximum Beauty |
Dynamic Programming |
JavaScript |
O(n) |
O(n) |
Explanation |
| 2846 |
Minimum Edge Weight Equilibrium Queries in a Tree |
Binary Search |
Python |
O(n) |
O(1) |
Explanation |
| 2858 |
Minimum Edge Reversals So Every Node Is Reachable |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 2862 |
Maximum Element-Sum of a Complete Subset of Indices |
Stack & Queue |
JavaScript |
O(n) |
O(n) |
Explanation |
| 2867 |
Count Valid Paths in a Tree |
Stack & Queue |
JavaScript |
O(n) |
O(n) |
Explanation |
| 2876 |
Count Visited Nodes in a Directed Graph |
Two Pointers |
JavaScript |
O(n) |
O(1) |
Explanation |
| 2897 |
Apply Operations on Array to Maximize Sum of Squares |
Stack & Queue |
JavaScript |
O(n) |
O(n) |
Explanation |
| 2902 |
Count of Sub-Multisets With Bounded Sum |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 2911 |
Minimum Changes to Make K Semi-palindromes |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 2916 |
Subarrays Distinct Element Sum of Squares II |
Hash Map |
JavaScript, Python |
O(n) |
O(n) |
Explanation |
| 2920 |
Maximum Points After Collecting Coins From All Nodes |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 2926 |
Maximum Balanced Subsequence Sum |
Two Pointers |
JavaScript |
O(n) |
O(1) |
Explanation |
| 2931 |
Maximum Spending After Buying Items |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 2935 |
Maximum Strong Pair XOR II |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 2940 |
Find Building Where Alice and Bob Can Meet |
Two Pointers |
JavaScript, Python |
O(n) |
O(1) |
Explanation |
| 2945 |
Find Maximum Non-decreasing Array Length |
Dynamic Programming |
JavaScript |
O(n) |
O(n) |
Explanation |
| 2949 |
Count Beautiful Substrings II |
Hash Map |
JavaScript |
O(n) |
O(n) |
Explanation |
| 2953 |
Count Complete Substrings |
Tree & Graph |
Python |
O(n) |
O(n) |
Explanation |
| 2954 |
Count the Number of Infection Sequences |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 2959 |
Number of Possible Sets of Closing Branches |
Array / General |
JavaScript |
O(n) |
O(1) |
Explanation |
| 2963 |
Count the Number of Good Partitions |
Hash Map |
JavaScript |
O(n) |
O(n) |
Explanation |
| 2968 |
Apply Operations to Maximize Frequency Score |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 2972 |
Count the Number of Incremovable Subarrays II |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 2977 |
Minimum Cost to Convert String II |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 2983 |
Palindrome Rearrangement Queries |
Two Pointers |
JavaScript |
O(n) |
O(1) |
Explanation |
| 3003 |
Maximize the Number of Partitions After Operations |
Tree & Graph |
Python |
O(n) |
O(n) |
Explanation |
| 3008 |
Find Beautiful Indices in the Given Array II |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 3013 |
Divide an Array Into Subarrays With Minimum Cost II |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 3017 |
Count the Number of Houses at a Certain Distance II |
Two Pointers |
JavaScript |
O(n) |
O(1) |
Explanation |
| 3022 |
Minimize OR of Remaining Elements Using Operations |
Bit Manipulation |
Python |
O(n) |
O(1) |
Explanation |
| 3027 |
Find the Number of Ways to Place People II |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 3031 |
Minimum Time to Revert Word to Initial State II |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 3036 |
Number of Subarrays That Match a Pattern II |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 3041 |
Maximize Consecutive Elements in an Array After Modification |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 3045 |
Count Prefix and Suffix Pairs II |
Prefix Sum |
Python |
O(n) |
O(n) |
Explanation |
| 3049 |
Earliest Second to Mark Indices II |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 3068 |
Find the Maximum Sum of Node Values |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 3072 |
Distribute Elements Into Two Arrays II |
Binary Search |
JavaScript |
O(n) |
O(1) |
Explanation |
| 3077 |
Maximum Strength of K Disjoint Subarrays |
Dynamic Programming |
JavaScript |
O(n) |
O(n) |
Explanation |
| 3086 |
Minimum Moves to Pick K Ones |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 3093 |
Longest Common Suffix Queries |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 3102 |
Minimize Manhattan Distances |
Tree & Graph |
Python |
O(n) |
O(n) |
Explanation |
| 3108 |
Minimum Cost Walk in Weighted Graph |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 3113 |
Find the Number of Subarrays Where Boundary Elements Are Maximum |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 3116 |
Kth Smallest Amount With Single Denomination Combination |
Backtracking |
Java |
O(n) |
O(1) |
Explanation |
| 3117 |
Minimum Sum of Values by Dividing Array |
Two Pointers |
JavaScript |
O(n) |
O(1) |
Explanation |
| 3123 |
Find Edges in Shortest Paths |
Stack & Queue |
JavaScript |
O(n) |
O(n) |
Explanation |
| 3130 |
Find All Possible Stable Binary Arrays II |
Dynamic Programming |
JavaScript |
O(n) |
O(n) |
Explanation |
| 3134 |
Find the Median of the Uniqueness Array |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 3139 |
Minimum Cost to Equalize Array |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 3145 |
Find Products of Elements of Big Array |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 3149 |
Find the Minimum Cost Array Permutation |
Backtracking |
Python |
O(n) |
O(1) |
Explanation |
| 3154 |
Find Number of Ways to Reach the K-th Stair |
Math & Logic |
JavaScript |
O(n) |
O(1) |
Explanation |
| 3161 |
Block Placement Queries |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 3165 |
Maximum Sum of Subsequence With Non-adjacent Elements |
Dynamic Programming |
Python |
O(n) |
O(n) |
Explanation |
| 3171 |
Find Subarray With Bitwise OR Closest to K |
Bit Manipulation |
Python |
O(n) |
O(1) |
Explanation |
| 3181 |
Maximum Total Reward Using Operations II |
Dynamic Programming |
Python |
O(n) |
O(n) |
Explanation |
| 3187 |
Peaks in Array |
Two Pointers |
JavaScript |
O(n) |
O(1) |
Explanation |
| 3197 |
Find the Minimum Area to Cover All Ones II |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 3203 |
Find Minimum Diameter After Merging Two Trees |
Two Pointers |
JavaScript |
O(n) |
O(1) |
Explanation |
| 3209 |
Number of Subarrays With AND Value of K |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 3219 |
Minimum Cost for Cutting Cake II |
Array / General |
JavaScript |
O(n) |
O(1) |
Explanation |
| 3225 |
Maximum Score From Grid Operations |
Dynamic Programming |
Python |
O(n) |
O(n) |
Explanation |
| 3229 |
Minimum Operations to Make Array Equal to Target |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 3235 |
Check if the Rectangle Corner Is Reachable |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 3241 |
Time Taken to Mark All Nodes |
Two Pointers |
JavaScript |
O(n) |
O(1) |
Explanation |
| 3244 |
Shortest Distance After Road Addition Queries II |
Two Pointers |
JavaScript |
O(n) |
O(1) |
Explanation |
| 3245 |
Alternating Groups III |
Two Pointers |
JavaScript |
O(n) |
O(1) |
Explanation |
| 3250 |
Find the Count of Monotonic Pairs I |
Monotonic Stack |
JavaScript |
O(n) |
O(n) |
Explanation |
| 3251 |
Find the Count of Monotonic Pairs II |
Monotonic Stack |
JavaScript |
O(n) |
O(n) |
Explanation |
| 3256 |
Maximum Value Sum by Placing Three Rooks I |
Stack & Queue |
Python |
O(n) |
O(n) |
Explanation |
| 3257 |
Maximum Value Sum by Placing Three Rooks II |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 3260 |
Find the Largest Palindrome Divisible by K |
Two Pointers |
JavaScript |
O(n) |
O(1) |
Explanation |
| 3261 |
Count Substrings That Satisfy K-Constraint II |
Sliding Window |
Python |
O(n) |
O(1) |
Explanation |
| 3266 |
Final Array State After K Multiplication Operations II |
Two Pointers |
JavaScript |
O(n) |
O(1) |
Explanation |
| 3267 |
Count Almost Equal Pairs II |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 3272 |
Find the Count of Good Integers |
Two Pointers |
JavaScript |
O(n) |
O(1) |
Explanation |
| 3273 |
Minimum Amount of Damage Dealt to Bob |
Array / General |
JavaScript |
O(n) |
O(1) |
Explanation |
| 3276 |
Select Cells in Grid With Maximum Score |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 3283 |
Maximum Number of Moves to Kill All Pawns |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 3287 |
Find the Maximum Sequence Value of Array |
Dynamic Programming |
Python |
O(n) |
O(n) |
Explanation |
| 3288 |
Length of the Longest Increasing Path |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 3292 |
Minimum Number of Valid Strings to Form Target II |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 3298 |
Count Substrings That Can Be Rearranged to Contain a String II |
Sliding Window |
Python |
O(n) |
O(1) |
Explanation |
| 3303 |
Find the Occurrence of First Almost Equal Substring |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 3307 |
Find the K-th Character in String Game II |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 3311 |
Construct 2D Grid Matching Graph Layout |
Two Pointers |
JavaScript |
O(n) |
O(1) |
Explanation |
| 3312 |
Sorted GCD Pair Queries |
Prefix Sum |
PHP |
O(n) |
O(n) |
Explanation |
| 3317 |
Find the Number of Possible Ways for an Event |
Math & Logic |
JavaScript |
O(n) |
O(1) |
Explanation |
| 3321 |
Find X-Sum of All K-Long Subarrays II |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 3327 |
Check if DFS Strings Are Palindromes |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 3333 |
Find the Original Typed String II |
Sliding Window |
JavaScript |
O(n) |
O(1) |
Explanation |
| 3336 |
Find the Number of Subsequences With Equal GCD |
Dynamic Programming |
PHP |
O(n) |
O(n) |
Explanation |
| 3337 |
Total Characters in String After Transformations II |
Hash Map |
JavaScript |
O(n) |
O(n) |
Explanation |
| 3343 |
Count Number of Balanced Permutations |
Backtracking |
JavaScript |
O(n) |
O(1) |
Explanation |
| 3347 |
Maximum Frequency of an Element After Performing Operations II |
Sliding Window |
Python |
O(n) |
O(1) |
Explanation |
| 3348 |
Smallest Divisible Digit Product II |
Two Pointers |
Python, TypeScript |
O(n) |
O(1) |
Explanation |
| 3352 |
Count K-Reducible Numbers Less Than N |
Two Pointers |
JavaScript |
O(n) |
O(1) |
Explanation |
| 3357 |
Minimize the Maximum Adjacent Element Difference |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 3363 |
Find the Maximum Number of Fruits Collected |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 3373 |
Maximize the Number of Target Nodes After Connecting Trees II |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 3374 |
First Letter Capitalization II |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 3378 |
Count Connected Components in LCM Graph |
Math & Logic |
Python |
O(n) |
O(1) |
Explanation |
| 3382 |
Maximum Area Rectangle With Point Constraints II |
Hash Map |
JavaScript |
O(n) |
O(n) |
Explanation |
| 3389 |
Minimum Operations to Make Character Frequencies Equal |
Dynamic Programming |
Python |
O(n) |
O(n) |
Explanation |
| 3395 |
Subsequences with a Unique Middle Mode I |
Hash Map |
JavaScript |
O(n) |
O(n) |
Explanation |
| 3398 |
Smallest Substring With Identical Characters I |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 3399 |
Smallest Substring With Identical Characters II |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 3405 |
Count the Number of Arrays with K Matching Adjacent Elements |
Array / General |
JavaScript |
O(n) |
O(1) |
Explanation |
| 3410 |
Maximize Subarray Sum After Removing All Occurrences of One Element |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 3414 |
Maximum Score of Non-overlapping Intervals |
Heap |
JavaScript |
O(n) |
O(n) |
Explanation |
| 3420 |
Count Non-Decreasing Subarrays After K Operations |
Two Pointers |
JavaScript |
O(n) |
O(1) |
Explanation |
| 3425 |
Longest Special Path |
Stack & Queue |
JavaScript |
O(n) |
O(n) |
Explanation |
| 3426 |
Manhattan Distances of All Arrangements of Pieces |
Stack & Queue |
JavaScript |
O(n) |
O(n) |
Explanation |
| 3430 |
Maximum and Minimum Sums of at Most Size K Subarrays |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 3435 |
Frequencies of Shortest Supersequences |
Hash Map |
JavaScript |
O(n) |
O(n) |
Explanation |
| 3444 |
Minimum Increments for Target Multiples in an Array |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 3445 |
Maximum Difference Between Even and Odd Frequency II |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 3449 |
Maximize the Minimum Game Score |
Tree & Graph |
Python |
O(n) |
O(n) |
Explanation |
| 3451 |
Find Invalid IP Addresses |
Database / SQL |
SQL |
O(n) |
O(n) |
Explanation |
| 3454 |
Separate Squares II |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 3455 |
Shortest Matching Substring |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 3459 |
Length of Longest V-Shaped Diagonal Segment |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 3463 |
Check If Digits Are Equal in String After Operations II |
Math & Logic |
JavaScript |
O(n) |
O(1) |
Explanation |
| 3464 |
Maximize the Distance Between Points on a Square |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 3470 |
Permutations IV |
Backtracking |
JavaScript |
O(n) |
O(1) |
Explanation |
| 3474 |
Lexicographically Smallest Generated String |
Sliding Window |
Python |
O(n) |
O(1) |
Explanation |
| 3480 |
Maximize Subarrays After Removing One Conflicting Pair |
Bit Manipulation |
Python |
O(n) |
O(1) |
Explanation |
| 3482 |
Analyze Organization Hierarchy |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 3485 |
Longest Common Prefix of K Strings After Removal |
Prefix Sum |
Python |
O(n) |
O(n) |
Explanation |
| 3486 |
Longest Special Path II |
Backtracking |
JavaScript |
O(n) |
O(1) |
Explanation |
| 3495 |
Minimum Operations to Make Array Elements Zero |
Bit Manipulation |
Python |
O(n) |
O(1) |
Explanation |
| 3500 |
Minimum Cost to Divide Array Into Subarrays |
Dynamic Programming |
Python |
O(n) |
O(n) |
Explanation |
| 3501 |
Maximize Active Section with Trade II |
Two Pointers |
PHP |
O(n) |
O(1) |
Explanation |
| 3505 |
Minimum Operations to Make Elements Within K Subarrays Equal |
Sliding Window |
Python |
O(n) |
O(1) |
Explanation |
| 3510 |
Minimum Pair Removal to Sort Array II |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 3515 |
Shortest Path in a Weighted Tree |
Hash Map |
JavaScript |
O(n) |
O(n) |
Explanation |
| 3518 |
Smallest Palindromic Rearrangement II |
Two Pointers |
PHP |
O(n) |
O(1) |
Explanation |
| 3525 |
Find X Value of Array II |
Binary Search |
JavaScript |
O(n) |
O(1) |
Explanation |
| 3530 |
Maximum Profit from Valid Topological Order in DAG |
Dynamic Programming |
JavaScript |
O(n) |
O(n) |
Explanation |
| 3533 |
Concatenated Divisibility |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 3534 |
Path Existence Queries in a Graph II |
Two Pointers |
PHP |
O(n) |
O(1) |
Explanation |
| 3538 |
Merge Operations for Minimum Travel Time |
Dynamic Programming |
Python |
O(n) |
O(n) |
Explanation |
| 3539 |
Find Sum of Array Product of Magical Sequences |
Dynamic Programming |
JavaScript |
O(n) |
O(n) |
Explanation |
| 3547 |
Maximum Sum of Edge Values in a Graph |
Array / General |
JavaScript |
O(n) |
O(1) |
Explanation |
| 3548 |
Equal Sum Grid Partition II |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 3553 |
Minimum Weighted Subgraph With the Required Paths II |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 3554 |
Find Category Recommendation Pairs |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 3559 |
Number of Ways to Assign Edge Weights II |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 3569 |
Maximize Count of Distinct Primes After Split |
Hash Map |
JavaScript |
O(n) |
O(n) |
Explanation |
| 3574 |
Maximize Subarray GCD Score |
Hash Map |
JavaScript |
O(n) |
O(n) |
Explanation |
| 3575 |
Maximum Good Subtree Score |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 3585 |
Find Weighted Median Node in Tree |
Binary Search |
Python |
O(n) |
O(1) |
Explanation |
| 3594 |
Minimum Time to Transport All Individuals |
Two Pointers |
JavaScript |
O(n) |
O(1) |
Explanation |
| 3600 |
Maximize Spanning Tree Stability with Upgrades |
Binary Search |
JavaScript |
O(n) |
O(1) |
Explanation |
| 3605 |
Minimum Stability Factor of Array |
Binary Search |
JavaScript |
O(n) |
O(1) |
Explanation |
| 3614 |
Process String with Special Operations II |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 3615 |
Longest Palindromic Path in Graph |
Two Pointers |
JavaScript |
O(n) |
O(1) |
Explanation |
| 3617 |
Find Students with Study Spiral Pattern |
Database / SQL |
SQL |
O(n) |
O(n) |
Explanation |
| 3620 |
Network Recovery Pathways |
Binary Search |
PHP |
O(n) |
O(1) |
Explanation |
| 3621 |
Number of Integers With Popcount-Depth Equal to K I |
Two Pointers |
JavaScript |
O(n) |
O(1) |
Explanation |
| 3624 |
Number of Integers With Popcount-Depth Equal to K II |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 3625 |
Count Number of Trapezoids II |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 3630 |
Partition Array for Maximum XOR and AND |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 3636 |
Threshold Majority Queries |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 3646 |
Next Special Palindrome Number |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 3651 |
Minimum Cost Path with Teleportations |
Dynamic Programming |
Python |
O(n) |
O(n) |
Explanation |
| 3655 |
XOR After Range Multiplication Queries II |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 3661 |
Maximum Walls Destroyed by Robots |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 3666 |
Minimum Operations to Equalize Binary String |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 3671 |
Sum of Beautiful Subsequences |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 3673 |
Find Zombie Sessions |
Database / SQL |
SQL |
O(n) |
O(n) |
Explanation |
| 3677 |
Count Binary Palindromic Numbers |
Tree & Graph |
Python |
O(n) |
O(n) |
Explanation |
| 3681 |
Maximum XOR of Subsequences |
Dynamic Programming |
Python |
O(n) |
O(n) |
Explanation |
| 3691 |
Maximum Total Subarray Value II |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 3695 |
Maximize Alternating Sum Using Swaps |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 3699 |
Number of ZigZag Arrays I |
Prefix Sum |
PHP |
O(n) |
O(n) |
Explanation |
| 3700 |
Number of ZigZag Arrays II |
Stack & Queue |
PHP |
O(n) |
O(n) |
Explanation |
| 3710 |
Maximum Partition Factor |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 3715 |
Sum of Perfect Square Ancestors |
Backtracking |
JavaScript |
O(n) |
O(1) |
Explanation |
| 3721 |
Longest Balanced Subarray II |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 3725 |
Count Ways to Choose Coprime Integers from Rows |
Array / General |
JavaScript |
O(n) |
O(1) |
Explanation |
| 3729 |
Count Distinct Subarrays Divisible by K in Sorted Array |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 3734 |
Lexicographically Smallest Palindromic Permutation Greater Than Target |
Backtracking |
Java |
O(n) |
O(1) |
Explanation |
| 3739 |
Count Subarrays With Majority Element II |
Prefix Sum |
PHP |
O(n) |
O(n) |
Explanation |
| 3748 |
Count Stable Subarrays |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 3753 |
Total Waviness of Numbers in Range II |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 3757 |
Number of Effective Subsequences |
Dynamic Programming |
Python |
O(n) |
O(n) |
Explanation |
| 3762 |
Minimum Operations to Equalize Subarrays |
Prefix Sum |
Python |
O(n) |
O(n) |
Explanation |
| 3764 |
Most Common Course Pairs |
Database / SQL |
SQL |
O(n) |
O(n) |
Explanation |
| 3768 |
Minimum Inversion Count in Subarrays of Fixed Length |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 3782 |
Last Remaining Integer After Alternating Deletion Operations |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 3785 |
Minimum Swaps to Avoid Forbidden Values |
Hash Map |
JavaScript |
O(n) |
O(n) |
Explanation |
| 3797 |
Count Routes to Climb a Rectangular Grid |
Sliding Window |
Python |
O(n) |
O(1) |
Explanation |
| 3801 |
Minimum Cost to Merge Sorted Lists |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 3806 |
Maximum Bitwise AND After Increment Operations |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 3812 |
Minimum Edge Toggles on a Tree |
Two Pointers |
JavaScript |
O(n) |
O(1) |
Explanation |
| 3816 |
Lexicographically Smallest String After Deleting Duplicate Characters |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 3821 |
Find Nth Smallest Integer With K One Bits |
Bit Manipulation |
Python |
O(n) |
O(1) |
Explanation |
| 3826 |
Minimum Partition Score |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 3830 |
Longest Alternating Subarray After Removing At Most One Element |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 3832 |
Find Users with Persistent Behavior Patterns |
Database / SQL |
SQL |
O(n) |
O(n) |
Explanation |
| 3841 |
Palindromic Path Queries in a Tree |
Binary Search |
JavaScript, Python |
O(n) |
O(1) |
Explanation |
| 3845 |
Maximum Subarray XOR with Bounded Range |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 3850 |
Count Sequences to K |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 3855 |
Sum of K-Digit Numbers in a Range |
Bit Manipulation |
Python |
O(n) |
O(1) |
Explanation |
| 3859 |
Count Subarrays With K Distinct Integers |
Sliding Window |
Python |
O(n) |
O(1) |
Explanation |
| 3864 |
Minimum Cost to Partition a Binary String |
Tree & Graph |
Python |
O(n) |
O(n) |
Explanation |
| 3873 |
Maximum Points Activated with One Addition |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 3878 |
Count Good Subarrays |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 3883 |
Count Non Decreasing Arrays With Given Digit Sums |
Dynamic Programming |
Python |
O(n) |
O(n) |
Explanation |
| 3886 |
Sum of Sortable Integers |
Dynamic Programming |
Python |
O(n) |
O(n) |
Explanation |
| 3887 |
Incremental Even-Weighted Cycle Queries |
Fast & Slow Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 3897 |
Maximum Value of Concatenated Binary Segments |
Bit Manipulation |
JavaScript |
O(n) |
O(1) |
Explanation |
| 3901 |
Good Subsequence Queries |
Dynamic Programming |
JavaScript |
O(n) |
O(n) |
Explanation |
| 3910 |
Count Connected Subgraphs with Even Node Sum |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 3911 |
K-th Smallest Remaining Even Integer in Subarray Queries |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 3920 |
Maximize Fixed Points After Deletions |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 3924 |
Minimum Threshold Path With Limited Heavy Edges |
Binary Search |
JavaScript |
O(n) |
O(1) |
Explanation |
| 3928 |
Minimum Cost to Buy Apples II |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 3934 |
Smallest Unique Subarray |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 3943 |
Number of Pairs After Increment |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 3948 |
Lexicographically Maximum MEX Array |
Array / General |
JavaScript |
O(n) |
O(1) |
Explanation |
| 3953 |
Maximum Score with Co-Prime Element |
Hash Map |
C++ |
O(n) |
O(n) |
Explanation |
| 3956 |
Maximum Sum of M Non-Overlapping Subarrays I |
Two Pointers |
JavaScript |
O(n) |
O(1) |
Explanation |
| 3957 |
Maximum Sum of M Non-Overlapping Subarrays II |
Dynamic Programming |
JavaScript |
O(n) |
O(n) |
Explanation |
| 3962 |
Maximum Subarray Sum After at Most K Swaps |
Hash Map |
C++ |
O(n) |
O(n) |
Explanation |
| 3971 |
Maximum Total Value |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 3977 |
Minimum Time to Reach Target With Limited Power |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 3981 |
Count Distinct Ways to Form Target from Two Strings |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 3985 |
Palindromic Subarray Sum |
Array / General |
Python |
O(n) |
O(1) |
Explanation |
| 3989 |
Maximum Consistent Columns in a Grid |
Dynamic Programming |
Python |
O(n) |
O(n) |
Explanation |
| 4003 |
Minimum Cost Path with Alternating Directions III |
Heap |
Python |
O(n) |
O(n) |
Explanation |
| 4007 |
Widest Possible Fence |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 4009 |
Minimum Possible Maximum Waiting Time |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 4013 |
Count Subarrays With Even Odd Ratio II |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 4017 |
Peaks in Array II |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 4027 |
Elevator Requests III |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 4033 |
Valid K-Unique Subarrays I |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |
| 4037 |
Maximum Valid Split Positions II |
Two Pointers |
JavaScript |
O(n) |
O(1) |
Explanation |
| 4046 |
Minimum Cost Path With At Most K Turns |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 4051 |
Count Subarrays with Distant Sums |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 4055 |
Count Shadow Pairs II |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 4059 |
Lexicographically Largest Power Array |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 4064 |
Longest Subarray Divisible by K with At Most One Negation II |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 4068 |
Maximize Meeting Earnings with Idle Gaps |
Dynamic Programming |
Python |
O(n) |
O(n) |
Explanation |
| 4100 |
Minimum Cost Path With Even XOR Parity |
Two Pointers |
Python |
O(n) |
O(1) |
Explanation |
| 4105 |
Repeated String Match II |
Tree & Graph |
JavaScript |
O(n) |
O(n) |
Explanation |
| 4109 |
Count Valid Suffix Sorts II |
Hash Map |
Python |
O(n) |
O(n) |
Explanation |