kamyu104
LeetCode-Solutions
C++

πŸ‹οΈ Python / Modern C++ Solutions of All 3977 LeetCode Problems (Weekly Update)

Last updated Jul 8, 2026
5.9k
Stars
1.8k
Forks
45
Issues
+8
Stars/day
Attention Score
89
Language breakdown
C++ 54.2%
Python 45.3%
TypeScript 0.4%
Java 0.1%
Go 0.0%
Shell 0.0%
β–Έ Files click to expand
README

LeetCode

Language  License  Update  Progress  SayThanks  Visitors

  • R.I.P. to my old Leetcode repository, where there were 5.7k+ stars and 2.2k+ forks (ever the top 3 in the field).
  • Since free questions may be even mistakenly taken down by some companies, only solutions will be post on now.
  • There are new LeetCode questions every week. I'll keep updating for full summary and better solutions.
  • For more problem solutions, you can see my LintCode, GoogleKickStart, GoogleCodeJamIO repositories.
  • For more challenging problem solutions, you can also see my GoogleCodeJam, MetaHackerCup repositories.
  • Hope you enjoy the journey of learning data structures and algorithms.
  • Notes: "πŸ”’" means your subscription of LeetCode premium membership is required for reading the question.

Solutions

Algorithms

JavaScript

Database

Pandas

Reference

Bit Manipulation

| # | Title | Solution | Time | Space | Difficulty | Tag | Note| |-----|---------------- | --------------- | --------------- | --------------- | ------------- |--------------|-----| 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(maxs^(1/5) * log(maxs))
runtime: O(log(max
s)) | O(maxs^(1/5))_ | Medium | πŸ”’ | Precompute, Bitmasks, Combinatorics, Binary Search 3370 | Smallest Number With All Set Bits | C++ Python | O(1) | O(1)_ | Easy | | Bit Manipulation 3566 | Partition Array into Two Equal Product Subsets | C++ Python | O(n * 2^n) | O(1)_ | Medium | | Bitmasks 3632 | Subarrays with XOR at Least K | C++ Python | O(nlogr) | O(t)_ | Hard | πŸ”’ | Bitmasks, Prefix Sum, Trie 3646 | Next Special Palindrome Number | C++ Python | precompute: O(9 2^9 + 16 p + plogp)
runtime:
O(logp) | O(p)_ | Hard | | Precompute, Bitmasks, Sort, Binary Search 3702 | Longest Subsequence With Non-Zero Bitwise XOR | C++ Python | O(n) | O(1)_ | Medium | | Bitmasks 3750 | Minimum Number of Flips to Reverse Binary String | C++ Python | O(logn) | O(1)_ | Easy | | Bitmasks 3766 | Minimum Operations to Make Binary Palindrome | C++ Python | precompute: O(sqrt(r) * logr)
runtime:
O(r) | O(r)_ | Medium | | Precompute, Bitmasks, Two Pointers 3769 | Sort Integers by Binary Reflection | C++ Python | O(nlogr + nlogn) | O(n)_ | Easy | | Sort, Bitmasks 3782 | Last Remaining Integer After Alternating Deletion Operations | C++ Python | O(1) | O(1)_ | Hard | | Bitmasks, Simulation 3827 | Count Monobit Integers | C++ Python | O(logn) | O(1)_ | Easy | | Bitmasks 3950 | Exactly One Consecutive Set Bits Pair | C++ Python | O(1) | O(1)_ | Easy | | Bit Manipulation


⬆️ Back to Top

Array

| # | Title | Solution | Time | Space | Difficulty | Tag | Note| |-----|---------------- | --------------- | --------------- | --------------- | ------------- |--------------|-----| 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 3361 | Shift Distance Between Two Strings | C++ Python | O(n + 26) | O(26)_ | Medium | | Prefix Sum 3379 | Transformed Array | C++ Python | O(n) | O(1)_ | Easy | | Array 3380 | Maximum Area Rectangle With Point Constraints I | C++ Python | O(nlogn) | O(n)_ | Medium | | Sort, Brute Force, BIT, Fenwick Tree, Hash Table 3382 | Maximum Area Rectangle With Point Constraints II | C++ Python | O(nlogn) | O(n)_ | Hard | | Sort, BIT, Fenwick Tree, Hash Table 3386 | Button with Longest Push Time | C++ Python | O(n) | O(1)_ | Easy | | Array 3392 | Count Subarrays of Length Three With a Condition | C++ Python | O(n) | O(1)_ | Easy | | Array 3400 | Maximum Number of Matching Indices After Right Shifts | C++ Python | O(n^2) | O(1)_ | Medium | πŸ”’ | Brute Force 3417 | Zigzag Grid Traversal With Skip | C++ Python | O(n * m) | O(1)_ | Easy | | Array 3423 | Maximum Difference Between Adjacent Elements in a Circular Array | C++ Python | O(n) | O(1)_ | Easy | | Array 3427 | Sum of Variable Length Subarrays | C++ Python | O(n) | O(n)_ | Easy | | Difference Array 3432 | Count Partitions with Even Sum Difference | C++ Python | O(n) | O(1)_ | Easy | | Prefix Sum 3440 | Reschedule Meetings for Maximum Free Time II | C++ Python | O(n) | O(1)_ | Medium | | Array 3446 | Sort Matrix by Diagonals | C++ Python | O(n^2 * logn) | O(n^2)_ | Medium | | Array, Sort 3452 | Sum of Good Numbers | C++ Python | O(n) | O(1)_ | Easy | | Array 3467 | Transform Array by Parity | C++ Python | O(n) | O(1)_ | Easy | | Array 3502 | Minimum Cost to Reach Every Position | C++ Python | O(n) | O(1)_ | Easy | | Prefix Sum 3514 | Number of Unique XOR Triplets II | C++ Python | O(nlogn) | O(n)_ | Medium | | Fast Walsh–Hadamard Transform, FWHT, Fast Subset Transform, FST, Hash Table 3531 | Count Covered Buildings | C++ Python | O(n) | O(n)_ | Medium | | Array 3537 | Fill a Special Grid | C++ Python | O(4^n) | O(1)_ | Medium | | Divide and Conquer, Array 3540 | Minimum Time to Visit All Houses | C++ Python | O(n + q) | O(n)_ | Medium | πŸ”’ | Prefix Sum 3546 | Equal Sum Grid Partition I | C++ Python | O(m * n) | O(1)_ | Medium | | Array 3548 | Equal Sum Grid Partition II | C++ Python | O(m n) | O(m n)_ | Hard | | Array, Hash Table 3549 | Multiply Two Polynomials | C++ Python | O((n + m) * log(n + m)) | O(n + m)_ | Hard | πŸ”’ | Fast Fourier Transform, FFT 3550 | Smallest Index With Digit Sum Equal to Index | C++ Python | O(nlogr) | O(1)_ | Easy | | Array 3569 | Maximize Count of Distinct Primes After Split | C++ Python | O(r + nlogn + qlogn) | O(r + n)_ | Medium | | Number Theory, BST, Sorted List, Segment Tree 3637 | Trionic Array I | C++ Python | O(n) | O(1)_ | Easy | | Array 3643 | Flip Square Submatrix Vertically | C++ Python | O(k^2) | O(1)_ | Easy | | Array 3653 | XOR After Range Multiplication Queries I | C++ Python | O(qlogm + (q + n) sqrt(n)) | O(n sqrt(n))_ | Medium || Sqrt Decomposition, Difference Array, Fast Exponentiation, Simulation 3655 | XOR After Range Multiplication Queries II | C++ Python | O(qlogm + (q + n) sqrt(n)) | O(n sqrt(n))_ | Hard || Sqrt Decomposition, Difference Array, Fast Exponentiation 3674 | Minimum Operations to Equalize Array | C++ Python | O(n) | O(1)_ | Easy || Array 3683 | Earliest Time to Finish One Task | C++ Python | O(n) | O(1)_ | Easy || Array 3687 | Library Late Fee Calculator | C++ Python | O(n) | O(1)_ | Easy |πŸ”’| Array 3688 | Bitwise OR of Even Numbers in an Array | C++ Python | O(n) | O(1)_ | Easy || Array 3696 | Maximum Distance Between Unequal Words in Array I | C++ Python | O(n * l) | O(1)_ | Easy |πŸ”’| Array 3700 | Number of ZigZag Arrays II | C++ Python | O((r - l)^3 * logn) | O((r - l)^2)_ | Hard | | Matrix Exponentiation 3701 | Compute Alternating Sum | C++ Python | O(n) | O(1)_ | Easy | | Array 3706 | Maximum Distance Between Unequal Words in Array II | C++ Python | O(n * l) | O(1)_ | Medium |πŸ”’| Array 3707 | Equal Score Substrings | C++ Python | O(n) | O(1)_ | Easy | | Array, Prefix Sum 3708 | Longest Fibonacci Subarray | C++ Python | O(n) | O(1)_ | Medium | | Array 3719 | Longest Balanced Subarray I | C++ Python | O(nlogn) | O(n)_ | Medium | | Brute Force, Segment Tree, Binary Search, Prefix Sum 3721 | Longest Balanced Subarray II | C++ Python | O(nlogn) | O(n)_ | Hard | | Segment Tree, Binary Search, Prefix Sum 3736 | Minimum Moves to Equal Array Elements III | C++ Python | O(n) | O(1)_ | Easy | | Array 3737 | Count Subarrays With Majority Element I | C++ Python | O(n) | O(n)_ | Medium | | Freq Table, Prefix Sum 3738 | Longest Non-Decreasing Subarray After Replacing at Most One Element | C++ Python | O(n) | O(n)_ | Medium | | Array, Prefix Sum 3739 | Count Subarrays With Majority Element II | C++ Python | O(n) | O(n)_ | Hard | | Freq Table, Prefix Sum 3751 | Total Waviness of Numbers in Range I | C++ Python | O(nlogn) | O(logn)_ | Medium | | Brute Force 3756 | Concatenate Non-Zero Digits and Multiply by Sum II | C++ Python | O(n) | O(n)_ | Medium | | Prefix Sum | 3762 | Minimum Operations to Equalize Subarrays | C++ Python | O((n + q) * logn) | O(nlogn)_ | Hard | | Prefix Sum, Coordinate Compression, Persistent Segment Tree, Binary Search | 3774 | Absolute Difference Between Maximum and Minimum K Elements | C++ Python | O(n) | O(1)_ | Easy | | Sort, Quick Select 3788 | Maximum Score of a Split | C++ Python | O(n) | O(1)_ | Medium | | Prefix Sum 3809 | Best Reachable Tower | C++ Python | O(n) | O(1)_ | Medium | | Array 3814 | Maximum Capacity Within Budget | C++ Python | O(n + b) | O(b)_ | Medium | | Hash Table, Prefix Sum, Sort, Mono Stack, Binary Search 3818 | Minimum Prefix Removal to Make Array Strictly Increasing | C++ Python | O(n) | O(1)_ | Medium | | Array 3819 | Rotate Non Negative Elements | C++ Python | O(n) | O(n)_ | Medium | | Array 3833 | Count Dominant Indices | C++ Python | O(n) | O(1)_ | Easy | | Array 3861 | Minimum Capacity Box | C++ Python | O(n) | O(1)_ | Easy | | Array 3862 | Find the Smallest Balanced Index | C++ Python | O(n) | O(1)_ | Medium | | Prefix Sum 3865 | Reverse K Subarrays | C++ Python | O(n) | O(1)_ | Medium | πŸ”’ | Array 3880 | Minimum Absolute Difference Between Two Values | C++ Python | O(n) | O(1)_ | Easy | | Array 3886 | Sum of Sortable Integers | C++ Python | O(nlog(logn)) | O(n)_ | Hard | | Prefix Sum, Number Theory 3898 | Find the Degree of Each Vertex | C++ Python | O(n * m) | O(1)_ | Easy | | Array 3903 | Smallest Stable Index I | C++ Python | O(n) | O(n)_ | Easy | | Prefix Sum 3904 | Smallest Stable Index II | C++ Python | O(n) | O(n)_ | Medium | | Prefix Sum 3907 | Count Smaller Elements With Opposite Parity | C++ Python | O(nlogn) | O(n)_ | Medium | πŸ”’ | Sort, Coordinate Compression, BIT, Fenwick Tree 3909 | Compare Sums of Bitonic Parts | C++ Python | O(n) | O(1)_ | Medium | | Array 3912 | Valid Elements in an Array | C++ Python | O(n) | O(n)_ | Medium | | Prefix Sum 3915 | Maximum Sum of Alternating Subsequence With Distance at Least K | C++ Python | O(nlogn) | O(n)_ | Hard | | Sort, Coordinate Compression, BIT, Fenwick Tree, Sliding Window, DP 3918 | Sum of Primes Between Number and Its Reverse | C++ Python | precompute: O(r)
runtime:
O(1) | O(r)_ | Medium | | Number Theory, Linear Sieve of Eratosthenes, Prefix Sum 3925 | Concatenate Array With Reverse | C++ Python | O(n) | O(1)_ | Easy | | Array 3933 | Largest Local Values in a Matrix II | C++ Python | O(n m logn logm) | O(n m logn logm)_ | Medium | | RMQ, 2D Sparse Table 3936 | Minimum Swaps to Move Zeros to End | C++ Python | O(n) | O(1)_ | Easy | | Array 3938 | Maximum Path Intersection Sum in a Grid | C++ Python | O(n * m) | O(1)_ | Medium | | Array, Kadane's Algorithm 3940 | Limit Occurrences in Sorted Array | C++ Python | O(n) | O(1)_ | Easy | | Array, Inplace 3942 | Minimum Operations to Sort a Permutation | C++ Python | O(n) | O(1)_ | Medium | | Array 3943 | Number of Pairs After Increment | C++ Python | O(n + m + q sqrt(m n)) | O(n + m)_ | Hard || Freq Table, Sqrt Decomposition 3951 | Minimum Energy to Maintain Brightness | C++ Python | O(nlogn) | O(1)_ | Medium | | Sort, Line Sweep 3951 | Minimum Energy to Maintain Brightness | C++ Python | O(nlogn) | O(1)_ | Medium | | Sort, Line Sweep 3963 | Create Grid With Exactly One Path | C++ Python | O(m * n) | O(1)_ | Easy | | Array


⬆️ Back to Top

String

| # | Title | Solution | Time | Space | Difficulty | Tag | Note| |-----|---------------- | --------------- | --------------- | --------------- | ------------- |--------------|-----| 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 3407 | Substring Matching Pattern | C++ Python | O(n + m) | O(m)_ | Easy | | String, KMP Algorithm 3455 | Shortest Matching Substring | C++ Python | O(n + m) | O(n + m)_ | Hard | | String, KMP Algorithm, Two Pointers 3456 | Find Special Substring of Length K | C++ Python | O(n) | O(1)_ | Easy | | String 3491 | Phone Number Prefix | C++ Python | O(l * nlogn) | O(1)_ | Easy | πŸ”’ | Trie, Sort 3498 | Reverse Degree of a String | C++ Python | O(n) | O(1)_ | Easy | | String 3529 | Count Cells in Overlapping Horizontal and Vertical Substrings | C++ Python | O(n m) | O(n m)_ | Medium | | Z-Function 3571 | Find the Shortest Superstring II | C++ Python | O(n + m) | O(n + m)_ | Easy | πŸ”’ | KMP Algorithm 3582 | Generate Tag for Video Caption | C++ Python | O(n) | O(1)_ | Easy | | String 3598 | Longest Common Prefix Between Adjacent Strings After Removals | C++ Python | O(n * l) | O(n)_ | Medium | | LCP, Prefix Sum 3606 | Coupon Code Validator | C++ Python | O(l nlogn) | O(n l)_ | Easy | | Hash Table, Sort 3744 | Find Kth Character in Expanded String | C++ Python | O(n) | O(1)_ | Medium | πŸ”’ | String 3746 | Minimum String Length After Balanced Removals | C++ Python | O(n) | O(1)_ | Medium | | String 3748 | Count Stable Subarrays | C++ Python | O(n + q) | O(n)_ | Hard | | Prefix Sum 3758 | Convert Number Words to Digits | C++ Python | O(n) | O(1)_ | Medium | πŸ”’ | String 3775 | Reverse Words With Same Vowel Count | C++ Python | O(n) | O(1)_ | Medium | | String, Inplace 3777 | Minimum Deletions to Make Alternating Substring | C++ Python | O((n + q) * logn) | O(n)_ | Hard | | BIT, Fenwick Tree 3794 | Reverse String Prefix | C++ Python | O(n) | O(1)_ | Easy | | String 3813 | Vowel-Consonant Score | C++ Python | O(n) | O(1)_ | Easy | | String 3823 | Reverse Letters Then Special Characters in a String | C++ Python | O(n) | O(1)_ | Easy | | String 3838 | Weighted Word Mapping | C++ Python | O(n * l) | O(1)_ | Easy | | String 3856 | Trim Trailing Vowels | C++ Python | O(n) | O(1)_ | Easy | | String 3860 | Unique Email Groups | C++ Python | O(n l) | O(n l)_ | Medium | πŸ”’ | String, Hash Table 3884 | First Matching Character From Both Ends | C++ Python | O(n) | O(1)_ | Medium | | String 3931 | Check Adjacent Digit Differences | C++ Python | O(n) | O(1)_ | Easy | | String 3941 | Password Strength | C++ Python | O(n) | O(1)_ | Medium | | String, Hash Table


⬆️ Back to Top

Linked List

| # | Title | Solution | Time | Space | Difficulty | Tag | Note| |-----|---------------- | --------------- | --------------- | --------------- | ------------- |--------------|-----| 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


⬆️ Back to Top

Stack

| # | Title | Solution | Time | Space | Difficulty | Tag | Note| |-----|---------------- | --------------- | --------------- | --------------- | ------------- |--------------|-----| 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 3676 | Count Bowl Subarrays | C++ Python | O(n) | O(n)_ | Medium | | Mono Stack 3703 | Remove K-Balanced Substrings | C++ Python | O(n) | O(n)_ | Medium | | Stack 3749 | Evaluate Valid Expressions | C++ Python | O(n) | O(n)_ | Hard | πŸ”’ | Stack 3834 | Merge Adjacent Equal Elements

Β© 2026 GitRepoTrend Β· kamyu104/LeetCode-Solutions Β· Updated daily from GitHub