Skip to content

Latest commit

 

History

History
503 lines (494 loc) · 107 KB

hash-map.md

File metadata and controls

503 lines (494 loc) · 107 KB

Hash Map LeetCode Problems

A collection of LeetCode problems solved using Hash Map pattern techniques, explanations, and complexity analysis.

Problems

Easy

# Problem Language Time Space Explanation
1 Two Sum JavaScript, Python O(n) O(n) Explanation
58 Length of Last Word Python O(n) O(n) Explanation
242 Valid Anagram PHP O(n) O(n) Explanation
290 Word Pattern C++ O(n) O(n) Explanation
387 First Unique Character in a String Python O(n) O(n) Explanation
405 Convert a Number to Hexadecimal Python O(n) O(n) Explanation
476 Number Complement Python O(n) O(n) Explanation
496 Next Greater Element I Python O(n) O(n) Explanation
504 Base 7 Python O(n) O(n) Explanation
594 Longest Harmonious Subsequence Python O(n) O(n) Explanation
599 Minimum Index Sum of Two Lists Python O(n) O(n) Explanation
697 Degree of an Array Python O(n) O(n) Explanation
705 Design HashSet Python O(n) O(n) Explanation
706 Design HashMap Python O(n) O(n) Explanation
717 1-bit and 2-bit Characters Python O(n) O(n) Explanation
748 Shortest Completing Word Python O(n) O(n) Explanation
844 Backspace String Compare Python O(n) O(n) Explanation
884 Uncommon Words from Two Sentences Python O(n) O(n) Explanation
905 Sort Array By Parity Python O(n) O(n) Explanation
914 X of a Kind in a Deck of Cards Python O(n) O(n) Explanation
933 Number of Recent Calls JavaScript, Python O(n) O(n) Explanation
953 Verifying an Alien Dictionary Python O(n) O(n) Explanation
1002 Find Common Characters Python O(n) O(n) Explanation
1009 Complement of Base 10 Integer Python O(n) O(n) Explanation
1114 Print in Order Java O(n) O(n) Explanation
1122 Relative Sort Array Python O(n) O(n) Explanation
1128 Number of Equivalent Domino Pairs Python O(n) O(n) Explanation
1160 Find Words That Can Be Formed by Characters Python O(n) O(n) Explanation
1189 Maximum Number of Balloons Kotlin O(n) O(n) Explanation
1207 Unique Number of Occurrences JavaScript, Python O(n) O(n) Explanation
1389 Create Target Array in the Given Order Python O(n) O(n) Explanation
1394 Find Lucky Integer in an Array Python O(n) O(n) Explanation
1399 Count Largest Group Python O(n) O(n) Explanation
1450 Number of Students Doing Homework at a Given Time Python O(n) O(n) Explanation
1460 Make Two Arrays Equal by Reversing Subarrays Python O(n) O(n) Explanation
1512 Number of Good Pairs Python O(n) O(n) Explanation
1566 Detect Pattern of Length M Repeated K or More Times Python O(n) O(n) Explanation
1636 Sort Array by Increasing Frequency C++ O(n) O(n) Explanation
1640 Check Array Formation Through Concatenation C++ O(n) O(n) Explanation
1748 Sum of Unique Elements C++ O(n) O(n) Explanation
1779 Find Nearest Point That Has the Same X or Y Coordinate C++ O(n) O(n) Explanation
1827 Minimum Operations to Make the Array Increasing C++ O(n) O(n) Explanation
1909 Remove One Element to Make the Array Strictly Increasing C++ O(n) O(n) Explanation
1913 Maximum Product Difference Between Two Pairs C++ O(n) O(n) Explanation
1941 Check if All Characters Have Equal Number of Occurrences C++ O(n) O(n) Explanation
2006 Count Number of Pairs With Absolute Difference K Python O(n) O(n) Explanation
2011 Final Value of Variable After Performing Operations JavaScript O(n) O(n) Explanation
2027 Minimum Moves to Convert String JavaScript O(n) O(n) Explanation
2037 Minimum Number of Moves to Seat Everyone Python O(n) O(n) Explanation
2053 Kth Distinct String in an Array JavaScript O(n) O(n) Explanation
2068 Check Whether Two Strings are Almost Equivalent JavaScript O(n) O(n) Explanation
2085 Count Common Words With One Occurrence JavaScript O(n) O(n) Explanation
2148 Count Elements With Strictly Smaller and Greater Elements Python O(n) O(n) Explanation
2190 Most Frequent Number Following Key In an Array Python O(n) O(n) Explanation
2206 Divide Array Into Equal Pairs Python O(n) O(n) Explanation
2273 Find Resultant Array After Removing Anagrams JavaScript O(n) O(n) Explanation
2287 Rearrange Characters to Make Target String Python O(n) O(n) Explanation
2341 Maximum Number of Pairs in Array Python O(n) O(n) Explanation
2347 Best Poker Hand Python O(n) O(n) Explanation
2363 Merge Similar Items JavaScript O(n) O(n) Explanation
2404 Most Frequent Even Element Python O(n) O(n) Explanation
2423 Remove Letter To Equalize Frequency Python O(n) O(n) Explanation
2451 Odd String Difference Python O(n) O(n) Explanation
2475 Number of Unequal Triplets in Array JavaScript O(n) O(n) Explanation
2506 Count Pairs Of Similar Strings Python O(n) O(n) Explanation
2635 Apply Transform Over Each Element in Array TypeScript O(n) O(n) Explanation
2703 Return Length of Arguments Passed TypeScript O(n) O(n) Explanation
2726 Calculator with Method Chaining TypeScript O(n) O(n) Explanation
2815 Max Pair Sum in an Array JavaScript O(n) O(n) Explanation
2891 Method Chaining Python O(n) O(n) Explanation
2980 Check if Bitwise OR Has Trailing Zeros Python O(n) O(n) Explanation
3005 Count Elements With Maximum Frequency Python O(n) O(n) Explanation
3014 Minimum Number of Pushes to Type Word I Dart O(n) O(n) Explanation
3120 Count the Number of Special Characters I C++ O(n) O(n) Explanation
3158 Find the XOR of Numbers Which Appear Twice Python O(n) O(n) Explanation
3184 Count Pairs That Form a Complete Day I Python O(n) O(n) Explanation
3318 Find X-Sum of All K-Long Subarrays I Python O(n) O(n) Explanation
3411 Maximum Subarray With Equal Products JavaScript O(n) O(n) Explanation
3442 Maximum Difference Between Even and Odd Frequency I JavaScript O(n) O(n) Explanation
3541 Find Most Frequent Vowel and Consonant JavaScript O(n) O(n) Explanation
3545 Minimum Deletions for At Most K Distinct Characters JavaScript O(n) O(n) Explanation
3591 Check if Any Element Has Prime Frequency JavaScript O(n) O(n) Explanation
3663 Find The Least Frequent Digit JavaScript O(n) O(n) Explanation
3692 Majority Frequency Characters JavaScript O(n) O(n) Explanation
3712 Sum of Elements With Frequency Divisible by K JavaScript O(n) O(n) Explanation
3740 Minimum Distance Between Three Equal Elements I Python O(n) O(n) Explanation
3783 Mirror Distance of an Integer Python O(n) O(n) Explanation
3838 Weighted Word Mapping Kotlin O(n) O(n) Explanation
3852 Smallest Pair With Different Frequencies JavaScript O(n) O(n) Explanation
3866 First Unique Even Element JavaScript O(n) O(n) Explanation
3921 Score Validator Python O(n) O(n) Explanation
3945 Digit Frequency Score Python O(n) O(n) Explanation
3978 Unique Middle Element JavaScript O(n) O(n) Explanation
4038 Count Integers Appearing in a Single Block JavaScript O(n) O(n) Explanation
4048 Count Values With Equally Spaced Occurrences I JavaScript O(n) O(n) Explanation
4065 Rearrange Array by Removing Distinct Values Python O(n) O(n) Explanation
4092 Binary Digit Score Python O(n) O(n) Explanation

Medium

# Problem Language Time Space Explanation
49 Group Anagrams JavaScript, Python O(n) O(n) Explanation
133 Clone Graph JavaScript O(n) O(n) Explanation
139 Word Break JavaScript, Python O(n) O(n) Explanation
146 LRU Cache JavaScript, Python O(n) O(n) Explanation
155 Min Stack JavaScript O(n) O(n) Explanation
165 Compare Version Numbers Python O(n) O(n) Explanation
166 Fraction to Recurring Decimal Python O(n) O(n) Explanation
192 Word Frequency Shell O(n) O(n) Explanation
211 Design Add and Search Words Data Structure JavaScript O(n) O(n) Explanation
318 Maximum Product of Word Lengths Python O(n) O(n) Explanation
355 Design Twitter Python O(n) O(n) Explanation
395 Longest Substring with At Least K Repeating Characters Python O(n) O(n) Explanation
398 Random Pick Index Python O(n) O(n) Explanation
399 Evaluate Division JavaScript O(n) O(n) Explanation
423 Reconstruct Original Digits from English Python O(n) O(n) Explanation
424 Longest Repeating Character Replacement Python O(n) O(n) Explanation
438 Find All Anagrams in a String Python O(n) O(n) Explanation
447 Number of Boomerangs Python O(n) O(n) Explanation
451 Sort Characters By Frequency Python O(n) O(n) Explanation
494 Target Sum Python O(n) O(n) Explanation
508 Most Frequent Subtree Sum JavaScript O(n) O(n) Explanation
524 Longest Word in Dictionary through Deleting Python O(n) O(n) Explanation
532 K-diff Pairs in an Array Python O(n) O(n) Explanation
535 Encode and Decode TinyURL Python O(n) O(n) Explanation
554 Brick Wall Python O(n) O(n) Explanation
560 Subarray Sum Equals K Python O(n) O(n) Explanation
609 Find Duplicate File in System Python O(n) O(n) Explanation
621 Task Scheduler Python O(n) O(n) Explanation
638 Shopping Offers JavaScript O(n) O(n) Explanation
648 Replace Words Python O(n) O(n) Explanation
652 Find Duplicate Subtrees Python O(n) O(n) Explanation
659 Split Array into Consecutive Subsequences Python O(n) O(n) Explanation
677 Map Sum Pairs Python O(n) O(n) Explanation
692 Top K Frequent Words Python O(n) O(n) Explanation
698 Partition to K Equal Sum Subsets JavaScript O(n) O(n) Explanation
720 Longest Word in Dictionary Python O(n) O(n) Explanation
721 Accounts Merge Python O(n) O(n) Explanation
743 Network Delay Time Python O(n) O(n) Explanation
756 Pyramid Transition Matrix Python O(n) O(n) Explanation
767 Reorganize String Python O(n) O(n) Explanation
781 Rabbits in Forest Python O(n) O(n) Explanation
791 Custom Sort String Python O(n) O(n) Explanation
792 Number of Matching Subsequences Python O(n) O(n) Explanation
811 Subdomain Visit Count Python O(n) O(n) Explanation
833 Find And Replace in String Python O(n) O(n) Explanation
840 Magic Squares In Grid JavaScript O(n) O(n) Explanation
846 Hand of Straights Python O(n) O(n) Explanation
886 Possible Bipartition Python O(n) O(n) Explanation
890 Find and Replace Pattern Python O(n) O(n) Explanation
911 Online Election JavaScript O(n) O(n) Explanation
916 Word Subsets Python O(n) O(n) Explanation
939 Minimum Area Rectangle Python O(n) O(n) Explanation
945 Minimum Increment to Make Array Unique Python O(n) O(n) Explanation
947 Most Stones Removed with Same Row or Column Python O(n) O(n) Explanation
954 Array of Doubled Pairs Python O(n) O(n) Explanation
957 Prison Cells After N Days Python O(n) O(n) Explanation
963 Minimum Area Rectangle II Python O(n) O(n) Explanation
966 Vowel Spellchecker Python O(n) O(n) Explanation
981 Time Based Key-Value Store JavaScript O(n) O(n) Explanation
1048 Longest String Chain Python O(n) O(n) Explanation
1054 Distant Barcodes Python O(n) O(n) Explanation
1072 Flip Columns For Maximum Number of Equal Rows JavaScript O(n) O(n) Explanation
1079 Letter Tile Possibilities Python O(n) O(n) Explanation
1090 Largest Values From Labels Python O(n) O(n) Explanation
1115 Print FooBar Alternately Java O(n) O(n) Explanation
1156 Swap For Longest Repeated Character Substring Python O(n) O(n) Explanation
1170 Compare Strings by Frequency of the Smallest Character Python O(n) O(n) Explanation
1202 Smallest String With Swaps Python O(n) O(n) Explanation
1218 Longest Arithmetic Subsequence of Given Difference Python O(n) O(n) Explanation
1234 Replace the Substring for Balanced String Python O(n) O(n) Explanation
1277 Count Square Submatrices with All Ones JavaScript O(n) O(n) Explanation
1282 Group the People Given the Group Size They Belong To Python O(n) O(n) Explanation
1296 Divide Array in Sets of K Consecutive Numbers Python O(n) O(n) Explanation
1297 Maximum Number of Occurrences of a Substring C++ O(n) O(n) Explanation
1311 Get Watched Videos by Your Friends Python O(n) O(n) Explanation
1318 Minimum Flips to Make a OR b Equal to c JavaScript O(n) O(n) Explanation
1338 Reduce Array Size to The Half Python O(n) O(n) Explanation
1347 Minimum Number of Steps to Make Two Strings Anagram Python O(n) O(n) Explanation
1348 Tweet Counts Per Frequency JavaScript O(n) O(n) Explanation
1357 Apply Discount Every n Orders JavaScript O(n) O(n) Explanation
1376 Time Needed to Inform All Employees Python O(n) O(n) Explanation
1386 Cinema Seat Allocation C++, Python O(n) O(n) Explanation
1396 Design Underground System JavaScript O(n) O(n) Explanation
1418 Display Table of Food Orders in a Restaurant Python O(n) O(n) Explanation
1424 Diagonal Traverse II JavaScript O(n) O(n) Explanation
1442 Count Triplets That Can Form Two Arrays of Equal XOR Python O(n) O(n) Explanation
1481 Least Number of Unique Integers after K Removals Python O(n) O(n) Explanation
1488 Avoid Flood in The City Python O(n) O(n) Explanation
1504 Count Submatrices With All Ones Python O(n) O(n) Explanation
1514 Path with Maximum Probability Python O(n) O(n) Explanation
1525 Number of Good Ways to Split a String Python O(n) O(n) Explanation
1558 Minimum Numbers of Function Calls to Make Target Array Python O(n) O(n) Explanation
1573 Number of Ways to Split a String Python O(n) O(n) Explanation
1577 Number of Ways Where Square of Number Is Equal to Product of Two Numbers Python O(n) O(n) Explanation
1590 Make Sum Divisible by P Python O(n) O(n) Explanation
1600 Throne Inheritance JavaScript O(n) O(n) Explanation
1604 Alert Using Same Key-Card Three or More Times in a One Hour Period Python O(n) O(n) Explanation
1647 Minimum Deletions to Make Character Frequencies Unique Python O(n) O(n) Explanation
1657 Determine if Two Strings Are Close JavaScript O(n) O(n) Explanation
1663 Smallest String With A Given Numeric Value Python O(n) O(n) Explanation
1664 Ways to Make a Fair Array Python O(n) O(n) Explanation
1674 Minimum Moves to Make Array Complementary C++ O(n) O(n) Explanation
1711 Count Good Meals Python O(n) O(n) Explanation
1722 Minimize Hamming Distance After Swap Operations Python O(n) O(n) Explanation
1726 Tuple with Same Product Python O(n) O(n) Explanation
1733 Minimum Number of People to Teach Python O(n) O(n) Explanation
1743 Restore the Array From Adjacent Pairs Python O(n) O(n) Explanation
1785 Minimum Elements to Add to Form a Given Sum Python O(n) O(n) Explanation
1797 Design Authentication Manager Python O(n) O(n) Explanation
1807 Evaluate the Bracket Pairs of a String C++ O(n) O(n) Explanation
1814 Count Nice Pairs in an Array Python O(n) O(n) Explanation
1817 Finding the Users Active Minutes Python O(n) O(n) Explanation
1865 Finding Pairs With a Certain Sum JavaScript O(n) O(n) Explanation
1899 Merge Triplets to Form Target Triplet Python O(n) O(n) Explanation
1915 Number of Wonderful Substrings Python O(n) O(n) Explanation
1930 Unique Length-3 Palindromic Subsequences Python O(n) O(n) Explanation
1943 Describe the Painting JavaScript O(n) O(n) Explanation
2001 Number of Pairs of Interchangeable Rectangles Python O(n) O(n) Explanation
2007 Find Original Array From Doubled Array Python O(n) O(n) Explanation
2013 Detect Squares Python O(n) O(n) Explanation
2023 Number of Pairs of Strings With Concatenation Equal to Target Python O(n) O(n) Explanation
2034 Stock Price Fluctuation Python O(n) O(n) Explanation
2048 Next Greater Numerically Balanced Number Python O(n) O(n) Explanation
2080 Range Frequency Queries Python O(n) O(n) Explanation
2115 Find All Possible Recipes from Given Supplies JavaScript O(n) O(n) Explanation
2150 Find All Lonely Numbers in the Array Python O(n) O(n) Explanation
2170 Minimum Operations to Make the Array Alternating Python O(n) O(n) Explanation
2178 Maximum Split of Positive Even Integers Python O(n) O(n) Explanation
2186 Minimum Number of Steps to Make Two Strings Anagram II Python O(n) O(n) Explanation
2216 Minimum Deletions to Make Array Beautiful Python O(n) O(n) Explanation
2225 Find Players With Zero or One Losses Python O(n) O(n) Explanation
2244 Minimum Rounds to Complete All Tasks Python O(n) O(n) Explanation
2260 Minimum Consecutive Cards to Pick Up Python O(n) O(n) Explanation
2261 K Divisible Elements Subarrays Python O(n) O(n) Explanation
2284 Sender With Largest Word Count Python O(n) O(n) Explanation
2295 Replace Elements in an Array JavaScript O(n) O(n) Explanation
2317 Maximum XOR After Operations Python O(n) O(n) Explanation
2342 Max Sum of a Pair With Equal Sum of Digits JavaScript O(n) O(n) Explanation
2349 Design a Number Container System Python O(n) O(n) Explanation
2352 Equal Row and Column Pairs JavaScript O(n) O(n) Explanation
2353 Design a Food Rating System JavaScript O(n) O(n) Explanation
2364 Count Number of Bad Pairs Python O(n) O(n) Explanation
2365 Task Scheduler II JavaScript O(n) O(n) Explanation
2408 Design SQL Python O(n) O(n) Explanation
2438 Range Product Queries of Powers Python O(n) O(n) Explanation
2452 Words Within Two Edits of Dictionary Python O(n) O(n) Explanation
2456 Most Popular Video Creator JavaScript O(n) O(n) Explanation
2461 Maximum Sum of Distinct Subarrays With Length K Python O(n) O(n) Explanation
2501 Longest Square Streak in an Array Python O(n) O(n) Explanation
2502 Design Memory Allocator JavaScript O(n) O(n) Explanation
2531 Make Number of Distinct Characters Equal Python O(n) O(n) Explanation
2537 Count the Number of Good Subarrays Python O(n) O(n) Explanation
2556 Disconnect Path in a Binary Matrix by at Most One Flip Python O(n) O(n) Explanation
2564 Substring XOR Queries Python O(n) O(n) Explanation
2572 Count the Number of Square-Free Subsets Python O(n) O(n) Explanation
2615 Sum of Distances JavaScript O(n) O(n) Explanation
2622 Cache With Time Limit JavaScript O(n) O(n) Explanation
2662 Minimum Cost of a Path With Special Roads JavaScript O(n) O(n) Explanation
2671 Frequency Tracker JavaScript O(n) O(n) Explanation
2707 Extra Characters in a String Python O(n) O(n) Explanation
2722 Join Two Arrays by ID TypeScript O(n) O(n) Explanation
2746 Decremental String Concatenation Python O(n) O(n) Explanation
2768 Number of Black Blocks Python O(n) O(n) Explanation
2779 Maximum Beauty of an Array After Applying Operation Python O(n) O(n) Explanation
2780 Minimum Index of a Valid Split JavaScript O(n) O(n) Explanation
2785 Sort Vowels in a String JavaScript O(n) O(n) Explanation
2789 Largest Element in an Array after Merge Operations JavaScript O(n) O(n) Explanation
2799 Count Complete Subarrays in an Array Python O(n) O(n) Explanation
2808 Minimum Seconds to Equalize a Circular Array JavaScript O(n) O(n) Explanation
2831 Find the Longest Equal Subarray Python O(n) O(n) Explanation
2841 Maximum Sum of Almost Unique Subarray Python O(n) O(n) Explanation
2845 Count of Interesting Subarrays JavaScript O(n) O(n) Explanation
2857 Count Pairs of Points With Distance k Python O(n) O(n) Explanation
2870 Minimum Number of Operations to Make Array Empty Python O(n) O(n) Explanation
2910 Minimum Number of Groups to Create a Valid Assignment JavaScript O(n) O(n) Explanation
2933 High-Access Employees JavaScript O(n) O(n) Explanation
2948 Make Lexicographically Smallest Array by Swapping Elements C++ O(n) O(n) Explanation
2981 Find Longest Special Substring That Occurs Thrice I Python O(n) O(n) Explanation
3020 Find the Maximum Number of Elements in Subset Java O(n) O(n) Explanation
3026 Maximum Good Subarray Sum JavaScript O(n) O(n) Explanation
3039 Apply Operations to Make String Empty Python O(n) O(n) Explanation
3044 Most Frequent Prime JavaScript O(n) O(n) Explanation
3048 Earliest Second to Mark Indices I Python O(n) O(n) Explanation
3081 Replace Question Marks in String to Minimize Its Value Python O(n) O(n) Explanation
3085 Minimum Deletions to Make String K-Special Python O(n) O(n) Explanation
3092 Most Frequent IDs JavaScript O(n) O(n) Explanation
3137 Minimum Number of Operations to Make Word K-Periodic Python O(n) O(n) Explanation
3138 Minimum Length of Anagram Concatenation Python O(n) O(n) Explanation
3160 Find the Number of Distinct Colors Among the Balls JavaScript O(n) O(n) Explanation
3164 Find the Number of Good Pairs II JavaScript O(n) O(n) Explanation
3176 Find the Maximum Length of a Good Subsequence I JavaScript O(n) O(n) Explanation
3185 Count Pairs That Form a Complete Day II Python O(n) O(n) Explanation
3186 Maximum Total Damage With Spell Casting Python O(n) O(n) Explanation
3212 Count Submatrices With Equal Frequency of X and Y Python O(n) O(n) Explanation
3223 Minimum Length of String After Operations Python O(n) O(n) Explanation
3286 Find a Safe Walk Through a Grid Java O(n) O(n) Explanation
3291 Minimum Number of Valid Strings to Form Target I Python O(n) O(n) Explanation
3302 Find the Lexicographically Smallest Valid Sequence C++ O(n) O(n) Explanation
3325 Count Substrings With K-Frequency Characters I Python O(n) O(n) Explanation
3365 Rearrange K Substrings to Form Target String JavaScript O(n) O(n) Explanation
3371 Identify the Largest Outlier in an Array Python O(n) O(n) Explanation
3387 Maximize Amount After Two Days of Conversions JavaScript O(n) O(n) Explanation
3404 Count Special Subsequences Python O(n) O(n) Explanation
3408 Design Task Manager JavaScript O(n) O(n) Explanation
3429 Paint House IV Python O(n) O(n) Explanation
3433 Count Mentions Per User JavaScript O(n) O(n) Explanation
3434 Maximum Frequency After Subarray Operation Python O(n) O(n) Explanation
3446 Sort Matrix by Diagonals Python O(n) O(n) Explanation
3462 Maximum Sum With at Most K Elements Python O(n) O(n) Explanation
3472 Longest Palindromic Subsequence After at Most K Operations Python O(n) O(n) Explanation
3484 Design Spreadsheet JavaScript O(n) O(n) Explanation
3522 Calculate Score After Performing Instructions JavaScript O(n) O(n) Explanation
3527 Find the Most Common Response JavaScript O(n) O(n) Explanation
3531 Count Covered Buildings JavaScript O(n) O(n) Explanation
3552 Grid Teleportation Traversal Python O(n) O(n) Explanation
3572 Maximize Y‑Sum by Picking a Triplet of Distinct X‑Values JavaScript O(n) O(n) Explanation
3588 Find Maximum Area of a Triangle Python O(n) O(n) Explanation
3607 Power Grid Maintenance Python O(n) O(n) Explanation
3623 Count Number of Trapezoids I Python O(n) O(n) Explanation
3645 Maximum Total from Optimal Activation Order JavaScript O(n) O(n) Explanation
3653 XOR After Range Multiplication Queries I Python O(n) O(n) Explanation
3659 Partition Array Into K-Distinct Groups JavaScript O(n) O(n) Explanation
3664 Two-Letter Card Game Python O(n) O(n) Explanation
3670 Maximum Product of Two Integers With No Common Bits Python O(n) O(n) Explanation
3709 Design Exam Scores Tracker JavaScript O(n) O(n) Explanation
3728 Stable Subarrays With Equal Boundary and Interior Sum Python O(n) O(n) Explanation
3761 Minimum Absolute Distance Between Mirror Pairs Python O(n) O(n) Explanation
3795 Minimum Subarray Length With Distinct Sum At Least K Python O(n) O(n) Explanation
3805 Count Caesar Cipher Pairs JavaScript O(n) O(n) Explanation
3811 Number of Alternating XOR Partitions Python O(n) O(n) Explanation
3815 Design Auction System JavaScript O(n) O(n) Explanation
3843 First Element with Unique Frequency JavaScript O(n) O(n) Explanation
3853 Merge Close Characters Python O(n) O(n) Explanation
3868 Minimum Cost to Equalize Arrays Using Swaps JavaScript O(n) O(n) Explanation
3885 Design Event Manager JavaScript O(n) O(n) Explanation
3889 Mirror Frequency Distance JavaScript O(n) O(n) Explanation
3890 Integers With Multiple Sum of Two Cubes Python O(n) O(n) Explanation
3900 Longest Balanced Substring After One Swap Python O(n) O(n) Explanation
3905 Multi Source Flood Fill Python O(n) O(n) Explanation
3913 Sort Vowels by Frequency JavaScript O(n) O(n) Explanation
3926 Count Valid Word Occurrences JavaScript O(n) O(n) Explanation
4040 Minimum Operations to Form Subset Sum I JavaScript O(n) O(n) Explanation
4049 Count Values With Equally Spaced Occurrences II JavaScript O(n) O(n) Explanation
4058 Maximum Pulse Value After One Subarray Rotation Python O(n) O(n) Explanation
4063 Longest Subarray Divisible by K with At Most One Negation I Python O(n) O(n) Explanation
4066 Maximum Equal Adjacent Pairs After at Most One Replacement JavaScript O(n) O(n) Explanation
4094 Count Frequency Staircase Subarrays I Python O(n) O(n) Explanation
4107 Count Valid Suffix Sorts I JavaScript O(n) O(n) Explanation

Hard

# Problem Language Time Space Explanation
87 Scramble String JavaScript O(n) O(n) Explanation
127 Word Ladder JavaScript O(n) O(n) Explanation
140 Word Break II Python O(n) O(n) Explanation
149 Max Points on a Line Python O(n) O(n) Explanation
218 The Skyline Problem JavaScript O(n) O(n) Explanation
220 Contains Duplicate III Python O(n) O(n) Explanation
332 Reconstruct Itinerary Python O(n) O(n) Explanation
432 All O`one Data Structure Python O(n) O(n) Explanation
446 Arithmetic Slices II - Subsequence Python O(n) O(n) Explanation
460 LFU Cache Python O(n) O(n) Explanation
466 Count The Repetitions Python O(n) O(n) Explanation
483 Smallest Good Base Python O(n) O(n) Explanation
514 Freedom Trail Python O(n) O(n) Explanation
685 Redundant Connection II Python O(n) O(n) Explanation
710 Random Pick with Blacklist Python O(n) O(n) Explanation
726 Number of Atoms JavaScript O(n) O(n) Explanation
732 My Calendar III JavaScript O(n) O(n) Explanation
736 Parse Lisp Expression Python O(n) O(n) Explanation
770 Basic Calculator IV Python O(n) O(n) Explanation
782 Transform to Chessboard Python O(n) O(n) Explanation
815 Bus Routes Python O(n) O(n) Explanation
827 Making A Large Island Python O(n) O(n) Explanation
828 Count Unique Characters of All Substrings of a Given String Python O(n) O(n) Explanation
895 Maximum Frequency Stack JavaScript O(n) O(n) Explanation
924 Minimize Malware Spread Python O(n) O(n) Explanation
928 Minimize Malware Spread II Python O(n) O(n) Explanation
982 Triples with Bitwise AND Equal To Zero Python O(n) O(n) Explanation
1001 Grid Illumination Python O(n) O(n) Explanation
1032 Stream of Characters Python O(n) O(n) Explanation
1074 Number of Submatrices That Sum to Target JavaScript O(n) O(n) Explanation
1095 Find in Mountain Array Python O(n) O(n) Explanation
1125 Smallest Sufficient Team JavaScript O(n) O(n) Explanation
1157 Online Majority Element In Subarray JavaScript O(n) O(n) Explanation
1178 Number of Valid Words for Each Puzzle Python O(n) O(n) Explanation
1187 Make Array Strictly Increasing Python O(n) O(n) Explanation
1224 Maximum Equal Frequency Python O(n) O(n) Explanation
1307 Verbal Arithmetic Puzzle Python O(n) O(n) Explanation
1345 Jump Game IV C++ O(n) O(n) Explanation
1639 Number of Ways to Form a Target String Given a Dictionary Python O(n) O(n) Explanation
1649 Create Sorted Array through Instructions JavaScript O(n) O(n) Explanation
1655 Distribute Repeating Integers JavaScript O(n) O(n) Explanation
1659 Maximize Grid Happiness JavaScript O(n) O(n) Explanation
1719 Number Of Ways To Reconstruct A Tree JavaScript O(n) O(n) Explanation
1770 Maximum Score from Performing Multiplication Operations Python O(n) O(n) Explanation
1787 Make the XOR of All Segments Equal to Zero Python O(n) O(n) Explanation
1799 Maximize Score After N Operations JavaScript O(n) O(n) Explanation
1815 Maximum Number of Groups Getting Fresh Donuts JavaScript O(n) O(n) Explanation
1912 Design Movie Rental System JavaScript O(n) O(n) Explanation
1928 Minimum Cost to Reach Destination in Time Python O(n) O(n) Explanation
1982 Find Array Given Subset Sums Python O(n) O(n) Explanation
2014 Longest Subsequence Repeated k Times Python O(n) O(n) Explanation
2019 The Score of Students Solving Math Expression Python O(n) O(n) Explanation
2025 Maximum Number of Ways to Partition an Array Python O(n) O(n) Explanation
2065 Maximum Path Quality of a Graph Python O(n) O(n) Explanation
2092 Find All People With Secret Python O(n) O(n) Explanation
2097 Valid Arrangement of Pairs JavaScript O(n) O(n) Explanation
2102 Sequentially Ordinal Rank Tracker Python O(n) O(n) Explanation
2157 Groups of Strings Python O(n) O(n) Explanation
2183 Count Array Pairs Divisible by K Python O(n) O(n) Explanation
2203 Minimum Weighted Subgraph With the Required Paths Python O(n) O(n) Explanation
2227 Encrypt and Decrypt Strings Python O(n) O(n) Explanation
2272 Substring With Largest Variance Python O(n) O(n) Explanation
2344 Minimum Deletions to Make Array Divisible Python O(n) O(n) Explanation
2435 Paths in Matrix Whose Sum Is Divisible by K Python O(n) O(n) Explanation
2449 Minimum Number of Operations to Make Arrays Similar Python O(n) O(n) Explanation
2488 Count Subarrays With Median K JavaScript O(n) O(n) Explanation
2499 Minimum Total Cost to Make Arrays Unequal Python O(n) O(n) Explanation
2514 Count Anagrams JavaScript O(n) O(n) Explanation
2561 Rearranging Fruits Python O(n) O(n) Explanation
2584 Split the Array to Make Coprime Products Python O(n) O(n) Explanation
2630 Memoize II TypeScript O(n) O(n) Explanation
2642 Design Graph With Shortest Path Calculator Python O(n) O(n) Explanation
2659 Make Array Empty JavaScript O(n) O(n) Explanation
2713 Maximum Strictly Increasing Cells in a Matrix Python O(n) O(n) Explanation
2732 Find a Good Subset of the Matrix Python O(n) O(n) Explanation
2781 Length of the Longest Valid Substring Python O(n) O(n) Explanation
2801 Count Stepping Numbers in Range JavaScript O(n) O(n) Explanation
2818 Apply Operations to Maximize Score Python O(n) O(n) Explanation
2827 Number of Beautiful Integers in the Range JavaScript O(n) O(n) Explanation
2902 Count of Sub-Multisets With Bounded Sum Python O(n) O(n) Explanation
2916 Subarrays Distinct Element Sum of Squares II JavaScript, Python O(n) O(n) Explanation
2935 Maximum Strong Pair XOR II Python O(n) O(n) Explanation
2949 Count Beautiful Substrings II JavaScript O(n) O(n) Explanation
2963 Count the Number of Good Partitions JavaScript O(n) O(n) Explanation
2968 Apply Operations to Maximize Frequency Score Python O(n) O(n) Explanation
2977 Minimum Cost to Convert String II Python O(n) O(n) Explanation
2999 Count the Number of Powerful Integers JavaScript O(n) O(n) Explanation
3013 Divide an Array Into Subarrays With Minimum Cost II Python O(n) O(n) Explanation
3041 Maximize Consecutive Elements in an Array After Modification Python O(n) O(n) Explanation
3049 Earliest Second to Mark Indices II Python O(n) O(n) Explanation
3093 Longest Common Suffix Queries Python O(n) O(n) Explanation
3134 Find the Median of the Uniqueness Array Python O(n) O(n) Explanation
3177 Find the Maximum Length of a Good Subsequence II JavaScript O(n) O(n) Explanation
3209 Number of Subarrays With AND Value of K Python O(n) O(n) Explanation
3267 Count Almost Equal Pairs II Python O(n) O(n) Explanation
3276 Select Cells in Grid With Maximum Score Python O(n) O(n) Explanation
3292 Minimum Number of Valid Strings to Form Target II Python O(n) O(n) Explanation
3321 Find X-Sum of All K-Long Subarrays II Python O(n) O(n) Explanation
3337 Total Characters in String After Transformations II JavaScript O(n) O(n) Explanation
3351 Sum of Good Subsequences Python O(n) O(n) Explanation
3382 Maximum Area Rectangle With Point Constraints II JavaScript O(n) O(n) Explanation
3395 Subsequences with a Unique Middle Mode I JavaScript O(n) O(n) Explanation
3410 Maximize Subarray Sum After Removing All Occurrences of One Element Python O(n) O(n) Explanation
3435 Frequencies of Shortest Supersequences JavaScript O(n) O(n) Explanation
3445 Maximum Difference Between Even and Odd Frequency II Python O(n) O(n) Explanation
3459 Length of Longest V-Shaped Diagonal Segment Python O(n) O(n) Explanation
3482 Analyze Organization Hierarchy Python O(n) O(n) Explanation
3509 Maximum Product of Subsequences With an Alternating Sum Equal to K Python O(n) O(n) Explanation
3515 Shortest Path in a Weighted Tree JavaScript O(n) O(n) Explanation
3548 Equal Sum Grid Partition II Python O(n) O(n) Explanation
3569 Maximize Count of Distinct Primes After Split JavaScript O(n) O(n) Explanation
3574 Maximize Subarray GCD Score JavaScript O(n) O(n) Explanation
3625 Count Number of Trapezoids II Python O(n) O(n) Explanation
3630 Partition Array for Maximum XOR and AND Python O(n) O(n) Explanation
3636 Threshold Majority Queries Python O(n) O(n) Explanation
3655 XOR After Range Multiplication Queries II Python O(n) O(n) Explanation
3695 Maximize Alternating Sum Using Swaps Python O(n) O(n) Explanation
3721 Longest Balanced Subarray II Python O(n) O(n) Explanation
3729 Count Distinct Subarrays Divisible by K in Sorted Array Python O(n) O(n) Explanation
3753 Total Waviness of Numbers in Range II Python O(n) O(n) Explanation
3785 Minimum Swaps to Avoid Forbidden Values JavaScript O(n) O(n) Explanation
3806 Maximum Bitwise AND After Increment Operations Python O(n) O(n) Explanation
3816 Lexicographically Smallest String After Deleting Duplicate Characters Python O(n) O(n) Explanation
3826 Minimum Partition Score Python O(n) O(n) Explanation
3850 Count Sequences to K Python O(n) O(n) Explanation
3873 Maximum Points Activated with One Addition Python O(n) O(n) Explanation
3934 Smallest Unique Subarray Python O(n) O(n) Explanation
3943 Number of Pairs After Increment Python O(n) O(n) Explanation
3953 Maximum Score with Co-Prime Element C++ O(n) O(n) Explanation
3962 Maximum Subarray Sum After at Most K Swaps C++ O(n) O(n) Explanation
3981 Count Distinct Ways to Form Target from Two Strings Python O(n) O(n) Explanation
4007 Widest Possible Fence Python O(n) O(n) Explanation
4009 Minimum Possible Maximum Waiting Time Python O(n) O(n) Explanation
4033 Valid K-Unique Subarrays I Python O(n) O(n) Explanation
4041 Minimum Operations to Form Subset Sum II JavaScript O(n) O(n) Explanation
4095 Count Frequency Staircase Subarrays II JavaScript O(n) O(n) Explanation
4109 Count Valid Suffix Sorts II Python O(n) O(n) Explanation