5.7k+
stars and 2.2k+
forks (ever the top 3 in the field).# | Title | Solution | Time | Space | Difficulty | Tag | Note |
---|---|---|---|---|---|---|---|
2151 | Maximum Good People Based on Statements | C++ Python | O(n^2 * 2^n) | O(1) | Hard | Bitmasks, Brute Force | |
2212 | Maximum Points in an Archery Competition | C++ Python | O(n * 2^n) | O(n) | Medium | Bitmasks, Brute Force | |
2220 | Minimum Bit Flips to Convert Number | C++ Python | O(logn) | O(1) | Easy | Bit Manipulation | |
2275 | Largest Combination With Bitwise AND Greater Than Zero | C++ Python | O(nlogr) | O(logr) | Medium | Bit Manipulation, Freq Table | |
2317 | Maximum XOR After Operations | C++ Python | O(n) | O(1) | Medium | Bit Manipulation, Greedy | |
2397 | Maximum Rows Covered by Columns | C++ Python | O(m * n + m * C(n, k)) | O(m) | Medium | Bitmasks, Hakmem Item 175 |
|
2411 | Smallest Subarrays With Maximum Bitwise OR | C++ Python | O(n) | O(1) | Medium | Bitmasks, Hash Table | |
2419 | Longest Subarray With Maximum Bitwise AND | C++ Python | O(n) | O(1) | Medium | Bit Manipulation | |
2425 | Bitwise XOR of All Pairings | C++ Python | O(n) | O(1) | Medium | Bit Manipulation | |
2429 | Minimize XOR | C++ Python | O(logn) | O(1) | Medium | Bit Manipulation, Greedy | |
2505 | Bitwise OR of All Subsequence Sums | C++ Python | O(n) | O(1) | Medium | Bit Manipulation | |
2527 | Find Xor-Beauty of Array | C++ Python | O(n) | O(1) | Medium | Bit Manipulation, Math | |
2595 | Number of Even and Odd Bits | C++ Python | O(1) | O(1) | Easy | Bit Manipulation | |
2859 | Sum of Values at Indices With K Set Bits | C++ Python | O(C(ceil(log2(n)), k)) | O(1) | Easy | Bitmasks, Hakmem Item 175 |
|
2917 | Find the K-or of an Array | C++ Python | O(nlogr) | O(1) | Easy | Bit Manipulation | |
2932 | Maximum Strong Pair XOR I | C++ Python | O(nlogr) | O(t) | Easy | variant of Maximum XOR of Two Numbers in an Array | Bit Manipulation, Greedy, Trie, DP, Sort, Two Pointers, Brute Force |
2935 | Maximum Strong Pair XOR II | C++ Python | O(nlogr) | O(t) | Hard | variant of Maximum XOR of Two Numbers in an Array | Bit Manipulation, Greedy, Trie, DP, Sort, Two Pointers |
2980 | Check if Bitwise OR Has Trailing Zeros | C++ Python | O(n) | O(1) | Easy | Bit Manipulation | |
2997 | Minimum Number of Operations to Make Array XOR Equal to K | C++ Python | O(n) | O(1) | Medium | Bit Manipulation | |
3064 | Guess the Number Using Bitwise Questions I | C++ Python | O(logn) | O(1) | Medium | Bit Manipulation | |
3094 | Guess the Number Using Bitwise Questions II | C++ Python | O(logr) | O(1) | Medium | Bit Manipulation | |
3125 | Maximum Number That Makes Result of Bitwise AND Zero | C++ Python | O(1) | O(1) | Medium | Bit Manipulation | |
3133 | Minimum Array End | C++ Python | O(logn) | O(1) | Medium | Bit Manipulation | |
3199 | Count Triplets with Even XOR Set Bits I | C++ Python | O(nlogr) | O(1) | Easy | Brute Force, Bit Manipulation, Parity | |
3215 | Count Triplets with Even XOR Set Bits II | C++ Python | O(nlogr) | O(1) | Medium | Bit Manipulation, Parity | |
3226 | Number of Bit Changes to Make Two Integers Equal | C++ Python | O(logn) | O(1) | Easy | Bit Manipulation | |
3289 | The Two Sneaky Numbers of Digitville | C++ Python | O(n) | O(1) | Easy | Bit Manipulation | |
3304 | Find the K-th Character in String Game I | C++ Python | O(n) | O(1) | Easy | Bitmasks | |
3307 | Find the K-th Character in String Game II | C++ Python | O(1) | O(1) | Hard | Bitmasks | |
3314 | Construct the Minimum Bitwise Array I | C++ Python | O(n) | O(1) | Easy | Bit Manipulation | |
3315 | Construct the Minimum Bitwise Array II | C++ Python | O(n) | O(1) | Medium | Bit Manipulation | |
3344 | Maximum Sized Array | C++ Python | precompute: O(max_s^(1/5) * log(max_s)) runtime: O(log(max_s)) |
O(max_s^(1/5)) | Medium | Precompute, Bitmasks, Combinatorics, Binary Search |
# | Title | Solution | Time | Space | Difficulty | Tag | Note |
---|---|---|---|---|---|---|---|
2007 | Find Original Array From Doubled Array | C++ Python | O(n + klogk) | O(k) | Medium | variant of Array of Doubled Pairs | |
2011 | Final Value of Variable After Performing Operations | C++ Python | O(n) | O(1) | Easy | ||
2012 | Sum of Beauty in the Array | C++ Python | O(n) | O(n) | Medium | Prefix Sum | |
2016 | Maximum Difference Between Increasing Elements | C++ Python | O(n) | O(1) | Easy | variant of Best Time to Buy and Sell Stock | |
2017 | Grid Game | C++ Python | O(n) | O(1) | Medium | Prefix Sum | |
2018 | Check if Word Can Be Placed In Crossword | C++ Python | O(m * n) | O(1) | Medium | ||
2022 | Convert 1D Array Into 2D Array | C++ Python | O(m * n) | O(1) | Easy | ||
2033 | Minimum Operations to Make a Uni-Value Grid | C++ Python | O(m * n) on average | O(m * n) | Medium | variant of Minimum Moves to Equal Array Elements II | Math, Median, Quick Select |
2035 | Partition Array Into Two Arrays to Minimize Sum Difference | C++ Python | O(n * 2^n) | O(2^n) | Hard | Meet in the Middle | |
2038 | Remove Colored Pieces if Both Neighbors are the Same Color | C++ Python | O(n) | O(1) | Medium | ||
2055 | Plates Between Candles | C++ Python | O(n + q) | O(n) | Medium | Prefix Sum | |
2057 | Smallest Index With Equal Value | C++ Python | O(n) | O(1) | Easy | ||
2075 | Decode the Slanted Ciphertext | C++ Python | O(n) | O(1) | Medium | ||
2078 | Two Furthest Houses With Different Colors | C++ Python | O(n) | O(1) | Easy | ||
2079 | Watering Plants | C++ Python | O(n) | O(1) | Medium | ||
2098 | Subsequence of Size K With the Largest Even Sum | C++ Python | O(n) on average | O(1) | Medium | Quick Select | |
2099 | Find Subsequence of Length K With the Largest Sum | C++ Python | O(n) on average | O(n) | Easy | Quick Select | |
2100 | Find Good Days to Rob the Bank | C++ Python | O(n) | O(n) | Medium | Prefix Sum | |
2106 | Maximum Fruits Harvested After at Most K Steps | C++ Python | O(n) | O(n) | Hard | Prefix Sum | |
2113 | Elements in Array After Removing and Replacing Elements | C++ Python | O(n) | O(1) | Medium | ||
2121 | Intervals Between Identical Elements | C++ Python | O(n) | O(n) | Medium | Prefix Sum | |
2122 | Recover the Original Array | C++ Python | O(n^2) | O(n) | Hard | ||
2128 | Remove All Ones With Row and Column Flips | C++ Python | O(m * n) | O(1) | Medium | ||
2132 | Stamping the Grid | C++ Python | O(m * n) | O(m * n) | Hard | Prefix Sum | |
2155 | All Divisions With the Highest Score of a Binary Array | C++ Python | O(n) | O(1) | Medium | Prefix Sum | |
2194 | Cells in a Range on an Excel Sheet | C++ Python | O(26^2) | O(1) | Easy | ||
2210 | Count Hills and Valleys in an Array | C++ Python | O(n) | O(1) | Easy | Simulation | |
2219 | Maximum Sum Score of Array | C++ Python | O(n) | O(1) | Medium | Prefix Sum | |
2237 | Count Positions on Street With Required Brightness | C++ Python | O(n + l) | O(min(n, l)) | Medium | Line Sweep | |
2239 | Find Closest Number to Zero | C++ Python | O(n) | O(1) | Easy | Array | |
2245 | Maximum Trailing Zeros in a Cornered Path | C++ Python | O(m * n) | O(m * n) | Medium | Prefix Sum | |
2256 | Minimum Average Difference | C++ Python | O(n) | O(1) | Medium | Prefix Sum | |
2270 | Number of Ways to Split Array | C++ Python | O(n) | O(1) | Medium | Prefix Sum | |
2271 | Maximum White Tiles Covered by a Carpet | C++ Python | O(nlogn) | O(1) | Medium | Sliding Window, Prefix Sum, Binary Search | |
2274 | Maximum Consecutive Floors Without Special Floors | C++ Python | O(nlogn) | O(1) | Medium | Sort | |
2293 | Min Max Game | C++ Python | O(n) | O(1) | Medium | Simulation | |
2319 | Check if Matrix Is X-Matrix | C++ Python | O(n^2) | O(1) | Easy | Array | |
2326 | Spiral Matrix IV | C++ Python | O(m * n) | O(1) | Medium | Linked List, Array | |
2373 | Largest Local Values in a Matrix | C++ Python | O(n^2) | O(1) | Easy | Array | |
2382 | Maximum Segment Sum After Removals | C++ Python | O(n) | O(n) | Hard | Prefix Sum, Sorted List, BST, Union Find | |
2391 | Minimum Amount of Time to Collect Garbage | C++ Python | O(n * l) | O(1) | Medium | Prefix Sum, Simulation | |
2406 | Divide Intervals Into Minimum Number of Groups | C++ Python | O(nlogn) | O(n) | Medium | Sort, Line Sweep | |
2407 | Longest Increasing Subsequence II | C++ Python | O(nlogn) | O(n) | Hard | variant of Longest Increasing Subsequence | Segment Tree, Coordinate Compression |
2428 | Maximum Sum of an Hourglass | C++ Python | O(m * n) | O(1) | Medium | Brute Force | |
2432 | The Employee That Worked on the Longest Task | C++ Python | O(l) | O(1) | Easy | Array | |
2433 | Find The Original Array of Prefix Xor | C++ Python | O(n) | O(1) | Medium | Array | |
2438 | Range Product Queries of Powers | C++ Python | O(logn + qlogr) | O(logn) | Medium | Prefix Sum | |
2446 | Determine if Two Events Have Conflict | C++ Python | O(1) | O(1) | Easy | Array | |
2460 | Apply Operations to an Array | C++ Python | O(n) | O(1) | Easy | Inplace, Array | |
2482 | Difference Between Ones and Zeros in Row and Column | C++ Python | O(m * n) | O(m + n) | Medium | Array | |
2500 | Delete Greatest Value in Each Row | C++ Python | O(m * nlogn) | O(1) | Easy | Array | |
2515 | Shortest Distance to Target String in a Circular Array | C++ Python | O(n) | O(1) | Easy | Array | |
2535 | Difference Between Element Sum and Digit Sum of an Array | C++ Python | O(nlogr) | O(1) | Easy | Array | |
2536 | Increment Submatrices by One | C++ Python | O(q + n^2) | O(1) | Medium | Line Sweep, Difference Matrix, Difference Array | |
2553 | Separate the Digits in an Array | C++ Python | O(n * logr) | O(1) | Easy | Array | |
2559 | Count Vowel Strings in Ranges | C++ Python | O(n + q) | O(n) | Medium | Prefix Sum | |
2569 | Handling Sum Queries After Update | C++ Python | O(nlogn + m + qlogn) | O(n) | Hard | Segment Tree | |
2574 | Left and Right Sum Differences | C++ Python | O(n) | O(1) | Easy | Prefix Sum | |
2580 | Count Ways to Group Overlapping Ranges | C++ Python | O(nlogn) | O(1) | Medium | Sort, Array | |
2639 | Find the Width of Columns of a Grid | C++ Python | O(m * n) | O(1) | Easy | Array | |
2640 | Find the Score of All Prefixes of an Array | C++ Python | O(n) | O(1) | Medium | Prefix Sum | |
2643 | Row With Maximum Ones | C++ Python | O(m * n) | O(1) | Easy | Array | |
2644 | Find the Maximum Divisibility Score | C++ Python | O(n * d) | O(1) | Easy | Brute force | |
2655 | Find Maximal Uncovered Ranges | C++ Python | O(nlogn) | O(n) | Medium | , variant of Merge Intervals | Sort, Line Sweep |
2660 | Determine the Winner of a Bowling Game | C++ Python | O(n) | O(1) | Medium | Array | |
2672 | Number of Adjacent Elements With the Same Color | C++ Python | O(n + q) | O(n) | Medium | Array | |
2683 | Neighboring Bitwise XOR | C++ Python | O(n) | O(1) | Medium | Array | |
2711 | Difference of Number of Distinct Values on Diagonals | C++ Python | O(m * n) | O(min(m, n)) | Medium | Prefix Sum | |
2717 | Semi-Ordered Permutation | C++ Python | O(n) | O(1) | Easy | Array | |
2733 | Neither Minimum nor Maximum | C++ Python | O(n) | O(1) | Easy | Array | |
2760 | Longest Even Odd Subarray With Threshold | C++ Python | O(n) | O(1) | Easy | Array | |
2765 | Longest Alternating Subarray | C++ Python | O(n) | O(1) | Easy | Array | |
2782 | Number of Unique Categories | C++ Python | O(n^2) | O(1) | Medium | Brute Force | |
2798 | Number of Employees Who Met the Target | C++ Python | O(n) | O(1) | Easy | Array | |
2848 | Points That Intersect With Cars | C++ Python | O(nlogn) | O(1) | Easy | Sort, Line Sweep | |
2855 | Minimum Right Shifts to Sort the Array | C++ Python | O(n) | O(1) | Easy | Array | |
2873 | Maximum Value of an Ordered Triplet I | C++ Python | O(n) | O(1) | Easy | Array | |
2874 | Maximum Value of an Ordered Triplet II | C++ Python | O(n) | O(1) | Easy | Array | |
2903 | Find Indices With Index and Value Difference I | C++ Python | O(n) | O(1) | Easy | Prefix Sum | |
2905 | Find Indices With Index and Value Difference II | C++ Python | O(n) | O(1) | Medium | Prefix Sum | |
2906 | Construct Product Matrix | C++ Python | O(m * n) | O(m * n) | Medium | Prefix Sum | |
2908 | Minimum Sum of Mountain Triplets I | C++ Python | O(n) | O(n) | Easy | Prefix Sum | |
2909 | Minimum Sum of Mountain Triplets II | C++ Python | O(n) | O(n) | Medium | Prefix Sum | |
2923 | Find Champion I | C++ Python | O(n^2) | O(1) | Easy | Array | |
2946 | Matrix Similarity After Cyclic Shifts | C++ Python | O(m * n) | O(1) | Easy | Array | |
2951 | Find the Peaks | C++ Python | O(n) | O(1) | Easy | Array | |
2965 | Find Missing and Repeated Values | C++ Python | O(n^2) | O(1) | Easy | Array, Freq Table, Bit Manipulation | |
2966 | Divide Array Into Arrays With Max Difference | C++ Python | O(nlogn) | O(1) | Medium | Sort, Array | |
3000 | Maximum Area of Longest Diagonal Rectangle | C++ Python | O(n) | O(1) | Easy | Array | |
3009 | Maximum Number of Intersections on the Chart | C++ Python | O(nlogn) | O(n) | Hard | Sort, Line Sweep, Coordinate Compression | |
3010 | Divide an Array Into Subarrays With Minimum Cost I | C++ Python | O(n) | O(1) | Easy | Array, Quick Select | |
3015 | Count the Number of Houses at a Certain Distance I | C++ Python | O(n) | O(n) | Medium | Math, Prefix Sum, Difference Array | |
3017 | Count the Number of Houses at a Certain Distance II | C++ Python | O(n) | O(1) | Hard | Math, Prefix Sum, Difference Array | |
3026 | Maximum Good Subarray Sum | C++ Python | O(n) | O(n) | Medium | Prefix Sum | |
3028 | Ant on the Boundary | C++ Python | O(n) | O(1) | Easy | Prefix Sum | |
3030 | Find the Grid of Region Average | C++ Python | O(m * n) | O(m * n) | Medium | Array | |
3033 | Modify the Matrix | C++ Python | O(m * n) | O(1) | Easy | Array | |
3038 | Maximum Number of Operations With the Same Score I | C++ Python | O(n) | O(1) | Easy | Array | |
3065 | Minimum Operations to Exceed Threshold Value I | C++ Python | O(n) | O(1) | Easy | Array | |
3069 | Distribute Elements Into Two Arrays I | C++ Python | O(n) | O(n) | Easy | Array | |
3070 | Count Submatrices with Top-Left Element and Sum Less Than k | C++ Python | O(n * m) | O(1) | Medium | Array, Prefix Sum | |
3071 | Minimum Operations to Write the Letter Y on a Grid | C++ Python | O(n^2) | O(1) | Medium | Array | |
3079 | Find the Sum of Encrypted Integers | C++ Python | O(nlogr) | O(1) | Easy | Array | |
3096 | Minimum Levels to Gain More Points | C++ Python | O(n) | O(n) | Medium | Prefix Sum | |
3105 | Longest Strictly Increasing or Strictly Decreasing Subarray | C++ Python | O(n) | O(1) | Easy | Array | |
3127 | Make a Square with the Same Color | C++ Python | O((n - w + 1)^2 * w^2) | O(1) | Easy | Array | |
3131 | Find the Integer Added to Array I | C++ Python | O(n) | O(1) | Easy | Array | |
3142 | Check if Grid Satisfies Conditions | C++ Python | O(m * n) | O(1) | Easy | Array | |
3147 | Taking Maximum Energy From the Mystic Dungeon | C++ Python | O(n) | O(1) | Medium | Array | |
3151 | Special Array I | C++ Python | O(n) | O(1) | Easy | Array | |
3152 | Special Array II | C++ Python | O(n + q) | O(n) | Medium | Prefix Sum | |
3153 | Sum of Digit Differences of All Pairs | C++ Python | O(nlogr) | O(10 * logr) | Medium | Prefix Sum | |
3159 | Find Occurrences of an Element in an Array | C++ Python | O(n + q) | O(n) | Medium | Array | |
3173 | Bitwise OR of Adjacent Elements | C++ Python | O(n) | O(1) | Easy | Array | |
3187 | Peaks in Array | C++ Python | O(n + qlogn) | O(n) | Hard | BIT, Fenwick Tree | |
3195 | Find the Minimum Area to Cover All Ones I | C++ Python | O(n * m) | O(1) | Medium | Array | |
3224 | Minimum Array Changes to Make Differences Equal | C++ Python | O(n + k) | O(k) | Medium | Prefix Sum, Difference Array | |
3279 | Maximum Total Area Occupied by Pistons | C++ Python | O(h) | O(h) | Hard | Line Sweep, Difference Array | |
3285 | Find Indices of Stable Mountains | C++ Python | O(n) | O(1) | Easy | Array | |
3300 | Minimum Element After Replacement With Digit Sum | C++ Python | O(nlogr) | O(1) | Easy | Array | |
3330 | Find the Original Typed String I | C++ Python | O(n) | O(1) | Easy | Array | |
3334 | Find the Maximum Factor Score of Array | C++ Python | O(nlogr) | O(n) | Medium | Prefix Sum | |
3349 | Adjacent Increasing Subarrays Detection I | C++ Python | O(n) | O(1) | Easy | Array | |
3350 | Adjacent Increasing Subarrays Detection II | C++ Python | O(n) | O(1) | Medium | Array | |
3353 | Minimum Total Operations | C++ Python | O(n) | O(1) | Easy | Array | |
3354 | Make Array Elements Equal to Zero | C++ Python | O(n) | O(n) | Easy | CodeChef Starters 146 - Bouncing Ball | Prefix Sum |
3355 | Zero Array Transformation I | C++ Python | O(n + q) | O(n) | Medium | Line Sweep |
# | Title | Solution | Time | Space | Difficulty | Tag | Note |
---|---|---|---|---|---|---|---|
2042 | Check if Numbers Are Ascending in a Sentence | C++ Python | O(n) | O(1) | Easy | ||
2047 | Number of Valid Words in a Sentence | C++ Python | O(n) | O(1) | Easy | ||
2048 | Next Greater Numerically Balanced Number | C++ Python | O(1) | O(1) | Medium | Permutations, Precompute, Binary Search | |
2081 | Sum of k-Mirror Numbers | C++ Python | O(10^6) | O(1) | Hard | String, Palindrome, Brute Force | |
2103 | Rings and Rods | C++ Python | O(n) | O(1) | Easy | ||
2108 | Find First Palindromic String in the Array | C++ Python | O(n) | O(1) | Easy | ||
2109 | Adding Spaces to a String | C++ Python | O(n) | O(1) | Medium | Inplace | |
2114 | Maximum Number of Words Found in Sentences | C++ Python | O(n) | O(1) | Easy | ||
2116 | Check if a Parentheses String Can Be Valid | C++ Python | O(n) | O(1) | Medium | ||
2124 | Check if All A's Appears Before All B's | C++ Python | O(n) | O(1) | Easy | ||
2129 | Capitalize the Title | C++ Python | O(n) | O(1) | Easy | ||
2131 | Longest Palindrome by Concatenating Two Letter Words | C++ Python | O(n) | O(n) | Medium | ||
2135 | Count Words Obtained After Adding a Letter | C++ Python | O(n) | O(n) | Medium | Bitmasks | |
2138 | Divide a String Into Groups of Size k | C++ Python | O(n) | O(1) | Easy | ||
2156 | Find Substring With Given Hash Value | C++ Python | O(n) | O(1) | Medium | Rabin-Karp Algorithm , Rolling Hash |
|
2157 | Groups of Strings | C++ Python | O(26 * n) | O(26 * n) | Hard | Bitmasks, Union Find | |
2168 | Unique Substrings With Equal Digit Frequency | C++ Python | O(n^2) | O(n^2) | Medium | Rabin-Karp Algorithm , Rolling Hash |
|
2185 | Counting Words With a Given Prefix | C++ Python | O(n * p) | O(1) | Easy | ||
2186 | Minimum Number of Steps to Make Two Strings Anagram II | C++ Python | O(n) | O(1) | Medium | variant of Minimum Number of Steps to Make Two Strings Anagram | |
2211 | Count Collisions on a Road | C++ Python | O(n) | O(1) | Medium | Counting, Simulation | |
2213 | Longest Substring of One Repeating Character | C++ Python | O(nlogn) | O(n) | Hard | Segment Tree | |
2223 | Sum of Scores of Built Strings | C++ Python | O(n) | O(n) | Hard | Z-Function |
|
2232 | Minimize Result by Adding Parentheses to Expression | C++ Python | O(n^2) | O(1) | Medium | Brute Force | |
2243 | Calculate Digit Sum of a String | C++ Python | O(n) | O(n) | Easy | Simulation | |
2255 | Count Prefixes of a Given String | C++ Python | O(n * l) | O(1) | Easy | String | |
2264 | Largest 3-Same-Digit Number in String | C++ Python | O(n) | O(1) | Easy | String | |
2269 | Find the K-Beauty of a Number | C++ Python | O(logn) | O(logn) | Easy | Sliding Window | |
2272 | Substring With Largest Variance | C++ Python | O(a^2 * n) | O(a) | Hard | Kadane's Algorithm |
|
2273 | Find Resultant Array After Removing Anagrams | C++ Python | O(n * l) | O(1) | Easy | Freq Table, Sort | |
2278 | Percentage of Letter in String | C++ Python | O(n) | O(1) | Easy | String | |
2288 | Apply Discount to Prices | C++ Python | O(n) | O(1) | Medium | String | |
2299 | Strong Password Checker II | C++ Python | O(n) | O(1) | Easy | String | |
2301 | Match Substring After Replacement | C++ Python | O(n * k) | O(m) | Hard | Brute Force | |
2315 | Count Asterisks | C++ Python | O(n) | O(1) | Easy | String | |
2381 | Shifting Letters II | C++ Python | O(n) | O(n) | Medium | Line Sweep | |
2390 | Removing Stars From a String | C++ Python | O(n) | O(n) | Medium | String, Stack | |
2414 | Length of the Longest Alphabetical Continuous Substring | C++ Python | O(n) | O(1) | Medium | String | |
2416 | Sum of Prefix Scores of Strings | C++ Python | O(n * l) | O(t) | Hard | Trie | |
2490 | Circular Sentence | C++ Python | O(n) | O(1) | Easy | String | |
2496 | Maximum Value of a String in an Array | C++ Python | O(n * l) | O(1) | Easy | String | |
2575 | Find the Divisibility Array of a String | C++ Python | O(n) | O(1) | Medium | Prefix Sum | |
2586 | Count the Number of Vowel Strings in Range | C++ Python | O(n) | O(1) | Medium | String | |
2678 | Number of Senior Citizens | C++ Python | O(n) | O(1) | Easy | String | |
2710 | Remove Trailing Zeros From a String | C++ Python | O(n) | O(1) | Easy | String | |
2729 | Check if The Number is Fascinating | C++ Python | O(logn) | O(1) | Easy | String, Bitmasks | |
2788 | Split Strings by Separator | C++ Python | O(n * l) | O(l) | Easy | String | |
2800 | Shortest String That Contains Three Strings | C++ Python | O(l) | O(l) | Medium | String, Brute Force, Longest Prefix Suffix, KMP Algorithm |
|
2810 | Faulty Keyboard | C++ Python | O(n) | O(n) | Easy | String, Deque | |
2828 | Check if a String Is an Acronym of Words | C++ Python | O(n) | O(1) | Easy | String | |
2843 | Count Symmetric Integers | C++ Python | O(rlogr) | O(r) | Easy | String, Brute Force, Memoization | |
2851 | String Transformation | C++ Python | O(n + logk) | O(n) | Hard | DP, Matrix Exponentiation, Math, Z-Function , KMP Algorithm |
|
2937 | Make Three Strings Equal | C++ Python | O(n) | O(1) | Easy | String | |
2942 | Find Words Containing Character | C++ Python | O(n * l) | O(1) | Easy | String | |
2967 | Minimum Cost to Make Array Equalindromic | C++ Python | O(n + logr) | O(logr) | Medium | variant of Find the Closest Palindrome | Sort, Quick Select, Math, String |
3019 | Number of Changing Keys | C++ Python | O(n) | O(1) | Easy | String | |
3023 | Find Pattern in Infinite Stream I | C++ Python | O(p + n) | O(p) | Medium | String, KMP Algorithm |
|
3029 | Minimum Time to Revert Word to Initial State I | C++ Python | O(n) | O(n) | Medium | String, Z-Function , Brute Force |
|
3031 | Minimum Time to Revert Word to Initial State II | C++ Python | O(n) | O(n) | Hard | String, Z-Function |
|
3034 | Number of Subarrays That Match a Pattern I | C++ Python | O(n) | O(m) | Medium | Brute Force, String, KMP Algorithm |
|
3036 | Number of Subarrays That Match a Pattern II | C++ Python | O(n) | O(m) | Hard | String, KMP Algorithm |
|
3037 | Find Pattern in Infinite Stream II | C++ Python | O(p + n) | O(p) | Hard | String, KMP Algorithm |
|
3042 | Count Prefix and Suffix Pairs I | C++ Python | O(n * l) | O(t) | Easy | Trie, Brute Force | |
3043 | Find the Length of the Longest Common Prefix | C++ Python | O((n + m) * l) | O(t) | Medium | Trie, Hash Table | |
3045 | Count Prefix and Suffix Pairs II | C++ Python | O(n * l) | O(t) | Hard | Trie | |
3076 | Shortest Uncommon Substring in an Array | C++ Python | O(n * l^2) | O(t) | Medium | Trie | |
3093 | Longest Common Suffix Queries | C++ Python | O((n + q) * l) | O(t) | Hard | Trie | |
3110 | Score of a String | C++ Python | O(n) | O(1) | Easy | String | |
3136 | Valid Word | C++ Python | O(n) | O(1) | Easy | String | |
3163 | String Compression III | C++ Python | O(n) | O(1) | Medium | String | |
3210 | Find the Encrypted String | C++ Python | O(n) | O(1) | Medium | String | |
3271 | Hash Divided String | C++ Python | O(n) | O(1) | Medium | String | |
3280 | Convert Date to Binary | C++ Python | O(1) | O(1) | Easy | String | |
3303 | Find the Occurrence of First Almost Equal Substring | C++ Python | O(n + m) | O(n + m) | Hard | Z-Function |
|
3324 | Find the Sequence of Strings Appeared on the Screen | C++ Python | O(n^2) | O(1) | Medium | String | |
3340 | Check Balanced String | C++ Python | O(n) | O(1) | Easy | String |
# | Title | Solution | Time | Space | Difficulty | Tag | Note |
---|---|---|---|---|---|---|---|
2058 | Find the Minimum and Maximum Number of Nodes Between Critical Points | C++ Python | O(n) | O(1) | Medium | ||
2074 | Reverse Nodes in Even Length Groups | C++ Python | O(n) | O(1) | Medium | ||
2095 | Delete the Middle Node of a Linked List | C++ Python | O(n) | O(1) | Medium | Two Pointers | |
2130 | Maximum Twin Sum of a Linked List | C++ Python | O(n) | O(1) | Medium | Two Pointers | |
2181 | Merge Nodes in Between Zeros | C++ Python | O(n) | O(1) | Medium | Two Pointers | |
2487 | Remove Nodes From Linked List | C++ Python | O(n) | O(n) | Medium | Mono Stack | |
2674 | Split a Circular Linked List | C++ Python | O(n) | O(1) | Medium | Two Pointers, Slow and Fast Pointers | |
2807 | Insert Greatest Common Divisors in Linked List | C++ Python | O(n) | O(1) | Medium | Linked List | |
2816 | Double a Number Represented as a Linked List | C++ Python | O(n) | O(1) | Medium | Linked List | |
3062 | Winner of the Linked List Game | C++ Python | O(n) | O(1) | Easy | Linked List | |
3063 | Linked List Frequency | C++ Python | O(n) | O(1) | Medium | Linked List | |
3217 | Delete Nodes From Linked List Present in Array | C++ Python | O(n) | O(m) | Medium | Hash Table, Linked List | |
3263 | Convert Doubly Linked List to Array I | C++ Python | O(n) | O(1) | Easy | Linked List | |
3294 | Convert Doubly Linked List to Array II | C++ Python | O(n) | O(1) | Medium | Linked List |
# | Title | Solution | Time | Space | Difficulty | Tag | Note |
---|---|---|---|---|---|---|---|
2104 | Sum of Subarray Ranges | C++ Python | O(n) | O(n) | Medium | Mono Stack | |
2197 | Replace Non-Coprime Numbers in Array | C++ Python | O(nlogm) | O(1) | Hard | Stack, Math | |
2281 | Sum of Total Strength of Wizards | C++ Python | O(n) | O(n) | Hard | variant of Largest Rectangle in Histogram | Mono Stack, Prefix Sum |
2282 | Number of People That Can Be Seen in a Grid | C++ Python | O(m * n) | O(m + n) | Medium | , variant of Number of Visible People in a Queue | Mono Stack |
2334 | Subarray With Elements Greater Than Varying Threshold | C++ Python | O(n) | O(n) | Hard | variant of Maximum Subarray Min-Product | Mono Stack |
2355 | Maximum Number of Books You Can Take | C++ Python | O(n) | O(n) | Hard | Mono Stack, Math | |
2454 | Next Greater Element IV | C++ Python | O(n) | O(n) | Hard | Mono Stack | |
2696 | Minimum String Length After Removing Substrings | C++ Python | O(n) | O(n) | Easy | Stack | |
2735 | Collecting Chocolates | C++ Python | O(n) | O(n) | Medium | Mono Stack, Difference Array, Prefix Sum, Binary Search, Mono Deque, Brute Force | |
2736 | Maximum Sum Queries | C++ Python | O(nlogn + mlogm + mlogn) | O(n + m) | Hard | Sort, Mono Stack, Binary Search | |
2764 | is Array a Preorder of Some Binary Tree | C++ Python | O(n) | O(n) | Medium | Stack | |
2832 | Maximal Range That Each Element Is Maximum in It | C++ Python | O(n) | O(n) | Medium | Mono Stack | |
2863 | Maximum Length of Semi-Decreasing Subarrays | C++ Python | O(n) | O(n) | Medium | Sort, Mono Stack | |
2865 | Beautiful Towers I | C++ Python | O(n) | O(n) | Medium | Mono Stack | |
2866 | Beautiful Towers II | C++ Python | O(n) | O(n) | Medium | Mono Stack | |
2899 | Last Visited Integers | C++ Python | O(n) | O(n) | Easy | Stack | |
3113 | Find the Number of Subarrays Where Boundary Elements Are Maximum | C++ Python | O(n) | O(n) | Hard | Mono Stack, Combinatorics | |
3174 | Clear Digits | C++ Python | O(n) | O(1) | Easy | Stack, Two Pointers |
# | Title | Solution | Time | Space | Difficulty | Tag | Note |
---|---|---|---|---|---|---|---|
2398 | Maximum Number of Robots Within Budget | C++ Python | O(n) | O(n) | Hard | Mono Deque, Sliding Window, Two Pointers |
# | Title | Solution | Time | Space | Difficulty | Tag | Note |
---|---|---|---|---|---|---|---|
2054 | Two Best Non-Overlapping Events | C++ Python | O(nlogn) | O(n) | Medium | Line Sweep, Heap | |
2163 | Minimum Difference in Sums After Removal of Elements | C++ Python | O(nlogn) | O(n) | Hard | Heap, Prefix Sum | |
2208 | Minimum Operations to Halve Array Sum | C++ Python | O(nlogn) | O(n) | Medium | Heap | |
2386 | Find the K-Sum of an Array | C++ Python | O(nlogn + klogk) | O(n + k) | Hard | BFS, Heap | |
2402 | Meeting Rooms III | C++ Python | O(mlogm + n + mlogn) | O(n) | Hard | Heap | |
2462 | Total Cost to Hire K Workers | C++ Python | O(c + klogc) | O(c) | Medium | Heap, Two Pointers | |
2519 | Count the Number of K-Big Indices | C++ Python | O(nlogk) | O(n) | Hard | Heap, Ordered Set, Sorted List | |
2530 | Maximal Score After Applying K Operations | C++ Python | O(n + klogn) | O(1) | Medium | Heap, Simulation | |
2558 | Take Gifts From the Richest Pile | C++ Python | O(n + klogn) | O(1) | Easy | Heap, Simulation | |
2818 | Apply Operations to Maximize Score | C++ Python | O(sqrt(r) + n * (logr + sqrt(r)/log(sqrt(r))) + klogn) | O(sqrt(r) + n) | Hard | Number Theory, Linear Sieve of Eratosthenes , Mono Stack, Greedy, Sort, Heap |
|
3066 | Minimum Operations to Exceed Threshold Value II | C++ Python | O(nlogn) | O(n) | Medium | Simulation, Heap | |
3080 | Mark Elements on Array by Performing Queries | C++ Python | O(q + nlogn) | O(n) | Medium | Hash Table, Heap | |
3092 | Most Frequent IDs | C++ Python | O(nlogn) | O(n) | Medium | Heap, BST, Sorted List | |
3256 | Maximum Value Sum by Placing Three Rooks I | C++ Python | O(m * n) | O(m + n) | Hard | Heap, Brute Force | |
3257 | Maximum Value Sum by Placing Three Rooks II | C++ Python | O(m * n) | O(m + n) | Hard | Heap, Brute Force | |
3275 | K-th Nearest Obstacle Queries | C++ Python | O(qlogk) | O(k) | Medium | Heap |
# | Title | Solution | Time | Space | Difficulty | Tag | Note |
---|---|---|---|---|---|---|---|
2003 | Smallest Missing Genetic Value in Each Subtree | C++ Python | O(n) | O(n) | Hard | DFS, Stack | |
2096 | Step-By-Step Directions From a Binary Tree Node to Another | C++ Python | O(n) | O(h) | Medium | DFS, Stack | |
2179 | Count Good Triplets in an Array | C++ Python | O(nlogn) | O(n) | Hard | variant of Create Sorted Array through Instructions | BIT, Fenwick Tree |
2196 | Create Binary Tree From Descriptions | C++ Python | O(n) | O(n) | Medium | ||
2236 | Root Equals Sum of Children | C++ Python | O(1) | O(1) | Easy | Tree | |
2277 | Closest Node to Path in Tree | C++ Python | O(n + q) | O(n + q) | Hard | Tree, BFS, Binary Lifting, Tarjan's Offline LCA Algorithm |
|
2421 | Number of Good Paths | C++ Python | O(nlogn) | O(n) | Hard | Sort, Union Find | |
2509 | Cycle Length Queries in a Tree | C++ Python | O(q * n) | O(1) | Hard | Tree, LCA | |
2846 | Minimum Edge Weight Equilibrium Queries in a Tree | C++ Python | O(r * (n + q)) | O(r * n + q) | Hard | Tree, Binary Lifting, Tarjan's Offline LCA Algorithm |
|
3109 | Find the Index of Permutation | C++ Python | O(nlogn) | O(n) | , Medium | variant of Count of Smaller Numbers After Self | BIT, Fenwick Tree, Combinatorics |
# | Title | Solution | Time | Space | Difficulty | Tag | Note |
---|---|---|---|---|---|---|---|
2006 | Count Number of Pairs With Absolute Difference K | C++ Python | O(n) | O(n) | Easy | variant of Two Sum | |
2023 | Number of Pairs of Strings With Concatenation Equal to Target | C++ Python | O(n * l) | O(n) | Medium | variant of Two Sum | |
2025 | Maximum Number of Ways to Partition an Array | C++ Python | O(n) | O(n) | Hard | Prefix Sum | |
2032 | Two Out of Three | C++ Python | O(n) | O(min(n, r)) | Easy | Counting | |
2053 | Kth Distinct String in an Array | C++ Python | O(n) | O(n) | Easy | ||
2068 | Check Whether Two Strings are Almost Equivalent | C++ Python | O(n) | O(1) | Easy | ||
2085 | Count Common Words With One Occurrence | C++ Python | O(m + n) | O(m + n) | Easy | ||
2120 | Execution of All Suffix Instructions Staying in a Grid | C++ Python | O(m) | O(m) | Medium | ||
2150 | Find All Lonely Numbers in the Array | C++ Python | O(n) | O(n) | Medium | ||
2154 | Keep Multiplying Found Values by Two | C++ Python | O(n) | O(n) | Easy | ||
2170 | Minimum Operations to Make the Array Alternating | C++ Python | O(n) | O(n) | Medium | Freq Table | |
2190 | Most Frequent Number Following Key In an Array | C++ Python | O(n) | O(n) | Easy | Freq Table | |
2201 | Count Artifacts That Can Be Extracted | C++ Python | O(a + d) | O(d) | Medium | Hash Table | |
2206 | Divide Array Into Equal Pairs | C++ Python | O(n) | O(n) | Easy | Hash Table | |
2215 | Find the Difference of Two Arrays | C++ Python | O(n) | O(n) | Easy | Hash Table | |
2225 | Find Players With Zero or One Losses | C++ Python | O(nlogn) | O(n) | Medium | Hash Table, Sort | |
2229 | Check if an Array Is Consecutive | C++ Python | O(n) | O(n) | Easy | Hash Table, Sort | |
2260 | Minimum Consecutive Cards to Pick Up | C++ Python | O(n) | O(n) | Medium | Hash Table | |
2261 | K Divisible Elements Subarrays | C++ Python | O(n^2) | O(t) | Medium | Trie, Rabin-Karp Algorithm |
|
2283 | Check if Number Has Equal Digit Count and Digit Value | C++ Python | O(n) | O(1) | Easy |