Convert Figma logo to code with AI

kamyu104 logoLeetCode-Solutions

🏋️ Python / Modern C++ Solutions of All 3283 LeetCode Problems (Weekly Update)

4,672
1,553
4,672
40

Top Related Projects

54,606

LeetCode Solutions: A Record of My Problem Solving Journey.( leetcode题解,记录自己的leetcode解题之路。)

Demonstrate all the questions on LeetCode in the form of animation.(用动画的形式呈现解LeetCode题目的思路)

✅ Solutions to LeetCode by Go, 100% test coverage, runtime beats 100% / LeetCode 题解

Solutions to LeetCode problems; updated daily. Subscribe to my YouTube channel for more.

:pencil2: LeetCode solutions in C++ 11 and Python3

Quick Overview

The kamyu104/LeetCode-Solutions repository is a comprehensive collection of solutions to LeetCode problems, implemented in various programming languages. It serves as a valuable resource for developers preparing for technical interviews or looking to improve their problem-solving skills.

Pros

  • Extensive coverage of LeetCode problems with solutions in multiple languages
  • Well-organized structure, making it easy to find specific problem solutions
  • Regularly updated with new solutions and improvements
  • Includes explanations and time/space complexity analysis for many solutions

Cons

  • May discourage independent problem-solving if relied upon too heavily
  • Some solutions might not be optimized or may lack detailed explanations
  • The large number of solutions can be overwhelming for beginners
  • Not all problems have solutions in every supported language

Code Examples

Here are a few examples of solutions from the repository:

  1. Two Sum problem (Python):
class Solution:
    def twoSum(self, nums: List[int], target: int) -> List[int]:
        num_map = {}
        for i, num in enumerate(nums):
            complement = target - num
            if complement in num_map:
                return [num_map[complement], i]
            num_map[num] = i
        return []

This solution uses a hash map to efficiently find the pair of numbers that sum up to the target.

  1. Reverse Linked List (C++):
class Solution {
public:
    ListNode* reverseList(ListNode* head) {
        ListNode* prev = nullptr;
        ListNode* curr = head;
        while (curr) {
            ListNode* next = curr->next;
            curr->next = prev;
            prev = curr;
            curr = next;
        }
        return prev;
    }
};

This code reverses a singly linked list iteratively.

  1. Valid Parentheses (Java):
class Solution {
    public boolean isValid(String s) {
        Stack<Character> stack = new Stack<>();
        for (char c : s.toCharArray()) {
            if (c == '(' || c == '[' || c == '{') {
                stack.push(c);
            } else if (stack.isEmpty() || !isMatching(stack.pop(), c)) {
                return false;
            }
        }
        return stack.isEmpty();
    }
    
    private boolean isMatching(char open, char close) {
        return (open == '(' && close == ')') ||
               (open == '[' && close == ']') ||
               (open == '{' && close == '}');
    }
}

This solution uses a stack to check if a string of parentheses is valid.

Getting Started

To use these solutions:

  1. Clone the repository:
    git clone https://github.com/kamyu104/LeetCode-Solutions.git
    
  2. Navigate to the desired problem's solution in your preferred language.
  3. Study the solution, understand the approach, and try to implement it yourself.
  4. Run the code with your own test cases to verify the solution.

Remember to use these solutions as a reference and learning tool, rather than simply copying them for LeetCode submissions.

Competitor Comparisons

54,606

LeetCode Solutions: A Record of My Problem Solving Journey.( leetcode题解,记录自己的leetcode解题之路。)

Pros of leetcode

  • More comprehensive explanations and detailed problem-solving approaches
  • Includes solutions in multiple programming languages (JavaScript, Python, C++, etc.)
  • Active community contributions and regular updates

Cons of leetcode

  • Less organized structure compared to LeetCode-Solutions
  • May contain some outdated or less optimized solutions
  • Inconsistent coding style across different contributors

Code Comparison

LeetCode-Solutions (Python):

class Solution:
    def twoSum(self, nums: List[int], target: int) -> List[int]:
        num_map = {}
        for i, num in enumerate(nums):
            if target - num in num_map:
                return [num_map[target - num], i]
            num_map[num] = i
        return []

leetcode (JavaScript):

var twoSum = function(nums, target) {
    const map = new Map();
    for (let i = 0; i < nums.length; i++) {
        const complement = target - nums[i];
        if (map.has(complement)) {
            return [map.get(complement), i];
        }
        map.set(nums[i], i);
    }
};

Both repositories provide efficient solutions to the "Two Sum" problem, but LeetCode-Solutions tends to have more concise and standardized code across different problems. The leetcode repository offers more explanations and alternative approaches, which can be beneficial for learning purposes.

Demonstrate all the questions on LeetCode in the form of animation.(用动画的形式呈现解LeetCode题目的思路)

Pros of LeetCodeAnimation

  • Provides visual animations for algorithm explanations, making concepts easier to understand
  • Includes explanations in Chinese, beneficial for Chinese-speaking users
  • Offers a more engaging learning experience through visual representations

Cons of LeetCodeAnimation

  • Limited coverage of LeetCode problems compared to LeetCode-Solutions
  • Animations may not be as comprehensive as detailed code explanations
  • Updates less frequently than LeetCode-Solutions

Code Comparison

LeetCode-Solutions (Python):

class Solution:
    def twoSum(self, nums: List[int], target: int) -> List[int]:
        num_map = {}
        for i, num in enumerate(nums):
            if target - num in num_map:
                return [num_map[target - num], i]
            num_map[num] = i

LeetCodeAnimation (Java):

public int[] twoSum(int[] nums, int target) {
    Map<Integer, Integer> map = new HashMap<>();
    for (int i = 0; i < nums.length; i++) {
        int complement = target - nums[i];
        if (map.containsKey(complement)) {
            return new int[] { map.get(complement), i };
        }
        map.put(nums[i], i);
    }
    throw new IllegalArgumentException("No two sum solution");
}

Both repositories provide solutions to LeetCode problems, but LeetCode-Solutions offers a wider range of problems and languages. LeetCodeAnimation focuses on visual explanations, which can be helpful for understanding complex algorithms, but may not cover as many problems or provide as detailed code explanations.

✅ Solutions to LeetCode by Go, 100% test coverage, runtime beats 100% / LeetCode 题解

Pros of LeetCode-Go

  • Written in Go, which may be preferred by some developers
  • Includes detailed explanations and time/space complexity analysis for solutions
  • Offers a more comprehensive set of problems (1000+) compared to LeetCode-Solutions

Cons of LeetCode-Go

  • Less frequently updated compared to LeetCode-Solutions
  • May have a steeper learning curve for those not familiar with Go

Code Comparison

LeetCode-Go (Go):

func twoSum(nums []int, target int) []int {
    m := make(map[int]int)
    for i, num := range nums {
        if j, ok := m[target-num]; ok {
            return []int{j, i}
        }
        m[num] = i
    }
    return nil
}

LeetCode-Solutions (Python):

def twoSum(self, nums: List[int], target: int) -> List[int]:
    num_map = {}
    for i, num in enumerate(nums):
        if target - num in num_map:
            return [num_map[target - num], i]
        num_map[num] = i
    return []

Both repositories provide solutions to LeetCode problems, but they differ in language and approach. LeetCode-Go offers more detailed explanations and a larger problem set, while LeetCode-Solutions provides solutions in multiple languages and is updated more frequently. The choice between the two depends on the user's preferred programming language and learning style.

Solutions to LeetCode problems; updated daily. Subscribe to my YouTube channel for more.

Pros of Leetcode

  • More comprehensive coverage of LeetCode problems, with solutions for a larger number of questions
  • Includes detailed explanations and comments for many solutions, making it easier for learners to understand the code
  • Offers solutions in multiple programming languages, catering to a wider audience

Cons of Leetcode

  • Less frequent updates compared to LeetCode-Solutions
  • Some solutions may not be as optimized or concise as those in LeetCode-Solutions
  • Repository structure is less organized, making it harder to navigate and find specific problems

Code Comparison

LeetCode-Solutions (Python):

def twoSum(self, nums: List[int], target: int) -> List[int]:
    lookup = {}
    for i, num in enumerate(nums):
        if target - num in lookup:
            return [lookup[target - num], i]
        lookup[num] = i
    return []

Leetcode (Java):

public int[] twoSum(int[] nums, int target) {
    Map<Integer, Integer> map = new HashMap<>();
    for (int i = 0; i < nums.length; i++) {
        if (map.containsKey(target - nums[i])) {
            return new int[]{map.get(target - nums[i]), i};
        }
        map.put(nums[i], i);
    }
    throw new IllegalArgumentException("No two sum solution");
}

Both solutions implement the Two Sum problem efficiently using a hash map, but LeetCode-Solutions uses Python while Leetcode uses Java. The overall approach is similar, demonstrating that both repositories provide effective solutions to LeetCode problems.

:pencil2: LeetCode solutions in C++ 11 and Python3

Pros of LeetCode

  • Organized by difficulty level (Easy, Medium, Hard), making it easier for users to find problems matching their skill level
  • Includes explanations and comments in the code, helping users understand the solutions better
  • Supports multiple programming languages, including C++, Python, and Java

Cons of LeetCode

  • Has fewer problems solved compared to LeetCode-Solutions
  • Less frequently updated, potentially missing newer LeetCode problems
  • May lack some of the more advanced or optimized solutions found in LeetCode-Solutions

Code Comparison

LeetCode (C++):

class Solution {
public:
    vector<int> twoSum(vector<int>& nums, int target) {
        unordered_map<int, int> mapping;
        vector<int> result;
        for (int i = 0; i < nums.size(); i++) {
            mapping[nums[i]] = i;
        }
        // ... (rest of the solution)
    }
};

LeetCode-Solutions (Python):

class Solution:
    def twoSum(self, nums: List[int], target: int) -> List[int]:
        lookup = {}
        for i, num in enumerate(nums):
            if target - num in lookup:
                return [lookup[target - num], i]
            lookup[num] = i

The LeetCode-Solutions example is more concise and uses a single-pass approach, while the LeetCode example separates the mapping creation and lookup steps.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

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

#TitleSolutionTimeSpaceDifficultyTagNote
2151Maximum Good People Based on StatementsC++ PythonO(n^2 * 2^n)O(1)HardBitmasks, Brute Force
2212Maximum Points in an Archery CompetitionC++ PythonO(n * 2^n)O(n)MediumBitmasks, Brute Force
2220Minimum Bit Flips to Convert NumberC++ PythonO(logn)O(1)EasyBit Manipulation
2275Largest Combination With Bitwise AND Greater Than ZeroC++ PythonO(nlogr)O(logr)MediumBit Manipulation, Freq Table
2317Maximum XOR After OperationsC++ PythonO(n)O(1)MediumBit Manipulation, Greedy
2397Maximum Rows Covered by ColumnsC++ PythonO(m * n + m * C(n, k))O(m)MediumBitmasks, Hakmem Item 175
2411Smallest Subarrays With Maximum Bitwise ORC++ PythonO(n)O(1)MediumBitmasks, Hash Table
2419Longest Subarray With Maximum Bitwise ANDC++ PythonO(n)O(1)MediumBit Manipulation
2425Bitwise XOR of All PairingsC++ PythonO(n)O(1)MediumBit Manipulation
2429Minimize XORC++ PythonO(logn)O(1)MediumBit Manipulation, Greedy
2505Bitwise OR of All Subsequence SumsC++ PythonO(n)O(1)Medium🔒Bit Manipulation
2527Find Xor-Beauty of ArrayC++ PythonO(n)O(1)MediumBit Manipulation, Math
2595Number of Even and Odd BitsC++ PythonO(1)O(1)EasyBit Manipulation
2859Sum of Values at Indices With K Set BitsC++ PythonO(C(ceil(log2(n)), k))O(1)EasyBitmasks, Hakmem Item 175
2917Find the K-or of an ArrayC++ PythonO(nlogr)O(1)EasyBit Manipulation
2932Maximum Strong Pair XOR IC++ PythonO(nlogr)O(t)Easyvariant of Maximum XOR of Two Numbers in an ArrayBit Manipulation, Greedy, Trie, DP, Sort, Two Pointers, Brute Force
2935Maximum Strong Pair XOR IIC++ PythonO(nlogr)O(t)Hardvariant of Maximum XOR of Two Numbers in an ArrayBit Manipulation, Greedy, Trie, DP, Sort, Two Pointers
2980Check if Bitwise OR Has Trailing ZerosC++ PythonO(n)O(1)EasyBit Manipulation
2997Minimum Number of Operations to Make Array XOR Equal to KC++ PythonO(n)O(1)MediumBit Manipulation
3064Guess the Number Using Bitwise Questions IC++ PythonO(logn)O(1)Medium🔒Bit Manipulation
3094Guess the Number Using Bitwise Questions IIC++ PythonO(logr)O(1)Medium🔒Bit Manipulation
3125Maximum Number That Makes Result of Bitwise AND ZeroC++ PythonO(1)O(1)Medium🔒Bit Manipulation
3133Minimum Array EndC++ PythonO(logn)O(1)MediumBit Manipulation
3199Count Triplets with Even XOR Set Bits IC++ PythonO(nlogr)O(1)Easy🔒Brute Force, Bit Manipulation, Parity
3215Count Triplets with Even XOR Set Bits IIC++ PythonO(nlogr)O(1)Medium🔒Bit Manipulation, Parity
3226Number of Bit Changes to Make Two Integers EqualC++ PythonO(logn)O(1)EasyBit Manipulation


Array

#TitleSolutionTimeSpaceDifficultyTagNote
2007Find Original Array From Doubled ArrayC++ PythonO(n + klogk)O(k)Mediumvariant of Array of Doubled Pairs
2011Final Value of Variable After Performing OperationsC++ PythonO(n)O(1)Easy
2012Sum of Beauty in the ArrayC++ PythonO(n)O(n)MediumPrefix Sum
2016Maximum Difference Between Increasing ElementsC++ PythonO(n)O(1)Easyvariant of Best Time to Buy and Sell Stock
2017Grid GameC++ PythonO(n)O(1)MediumPrefix Sum
2018Check if Word Can Be Placed In CrosswordC++ PythonO(m * n)O(1)Medium
2022Convert 1D Array Into 2D ArrayC++ PythonO(m * n)O(1)Easy
2033Minimum Operations to Make a Uni-Value GridC++ PythonO(m * n) on averageO(m * n)Mediumvariant of Minimum Moves to Equal Array Elements IIMath, Median, Quick Select
2035Partition Array Into Two Arrays to Minimize Sum DifferenceC++ PythonO(n * 2^n)O(2^n)HardMeet in the Middle
2038Remove Colored Pieces if Both Neighbors are the Same ColorC++ PythonO(n)O(1)Medium
2055Plates Between CandlesC++ PythonO(n + q)O(n)MediumPrefix Sum
2057Smallest Index With Equal ValueC++ PythonO(n)O(1)Easy
2075Decode the Slanted CiphertextC++ PythonO(n)O(1)Medium
2078Two Furthest Houses With Different ColorsC++ PythonO(n)O(1)Easy
2079Watering PlantsC++ PythonO(n)O(1)Medium
2098Subsequence of Size K With the Largest Even SumC++ PythonO(n) on averageO(1)Medium🔒Quick Select
2099Find Subsequence of Length K With the Largest SumC++ PythonO(n) on averageO(n)EasyQuick Select
2100Find Good Days to Rob the BankC++ PythonO(n)O(n)MediumPrefix Sum
2106Maximum Fruits Harvested After at Most K StepsC++ PythonO(n)O(n)HardPrefix Sum
2113Elements in Array After Removing and Replacing ElementsC++ PythonO(n)O(1)Medium🔒
2121Intervals Between Identical ElementsC++ PythonO(n)O(n)MediumPrefix Sum
2122Recover the Original ArrayC++ PythonO(n^2)O(n)Hard
2128Remove All Ones With Row and Column FlipsC++ PythonO(m * n)O(1)Medium🔒
2132Stamping the GridC++ PythonO(m * n)O(m * n)HardPrefix Sum
2155All Divisions With the Highest Score of a Binary ArrayC++ PythonO(n)O(1)MediumPrefix Sum
2194Cells in a Range on an Excel SheetC++ PythonO(26^2)O(1)Easy
2210Count Hills and Valleys in an ArrayC++ PythonO(n)O(1)EasySimulation
2219Maximum Sum Score of ArrayC++ PythonO(n)O(1)Medium🔒Prefix Sum
2237Count Positions on Street With Required BrightnessC++ PythonO(n + l)O(min(n, l))Medium🔒Line Sweep
2239Find Closest Number to ZeroC++ PythonO(n)O(1)EasyArray
2245Maximum Trailing Zeros in a Cornered PathC++ PythonO(m * n)O(m * n)MediumPrefix Sum
2256Minimum Average DifferenceC++ PythonO(n)O(1)MediumPrefix Sum
2270Number of Ways to Split ArrayC++ PythonO(n)O(1)MediumPrefix Sum
2271Maximum White Tiles Covered by a CarpetC++ PythonO(nlogn)O(1)MediumSliding Window, Prefix Sum, Binary Search
2274Maximum Consecutive Floors Without Special FloorsC++ PythonO(nlogn)O(1)MediumSort
2293Min Max GameC++ PythonO(n)O(1)MediumSimulation
2319Check if Matrix Is X-MatrixC++ PythonO(n^2)O(1)EasyArray
2326Spiral Matrix IVC++ PythonO(m * n)O(1)MediumLinked List, Array
2373Largest Local Values in a MatrixC++ PythonO(n^2)O(1)EasyArray
2382Maximum Segment Sum After RemovalsC++ PythonO(n)O(n)HardPrefix Sum, Sorted List, BST, Union Find
2391Minimum Amount of Time to Collect GarbageC++ PythonO(n * l)O(1)MediumPrefix Sum, Simulation
2406Divide Intervals Into Minimum Number of GroupsC++ PythonO(nlogn)O(n)MediumSort, Line Sweep
2407Longest Increasing Subsequence IIC++ PythonO(nlogn)O(n)Hardvariant of Longest Increasing SubsequenceSegment Tree, Coordinate Compression
2428Maximum Sum of an HourglassC++ PythonO(m * n)O(1)MediumBrute Force
2432The Employee That Worked on the Longest TaskC++ PythonO(l)O(1)EasyArray
2433Find The Original Array of Prefix XorC++ PythonO(n)O(1)MediumArray
2438Range Product Queries of PowersC++ PythonO(logn + qlogr)O(logn)MediumPrefix Sum
2446Determine if Two Events Have ConflictC++ PythonO(1)O(1)EasyArray
2460Apply Operations to an ArrayC++ PythonO(n)O(1)EasyInplace, Array
2482Difference Between Ones and Zeros in Row and ColumnC++ PythonO(m * n)O(m + n)MediumArray
2500Delete Greatest Value in Each RowC++ PythonO(m * nlogn)O(1)EasyArray
2515Shortest Distance to Target String in a Circular ArrayC++ PythonO(n)O(1)EasyArray
2535Difference Between Element Sum and Digit Sum of an ArrayC++ PythonO(nlogr)O(1)EasyArray
2536Increment Submatrices by OneC++ PythonO(q + n^2)O(1)MediumLine Sweep, Difference Matrix, Difference Array
2553Separate the Digits in an ArrayC++ PythonO(n * logr)O(1)EasyArray
2559Count Vowel Strings in RangesC++ PythonO(n + q)O(n)MediumPrefix Sum
2569Handling Sum Queries After UpdateC++ PythonO(nlogn + m + qlogn)O(n)HardSegment Tree
2574Left and Right Sum DifferencesC++ PythonO(n)O(1)EasyPrefix Sum
2580Count Ways to Group Overlapping RangesC++ PythonO(nlogn)O(1)MediumSort, Array
2639Find the Width of Columns of a GridC++ PythonO(m * n)O(1)EasyArray
2640Find the Score of All Prefixes of an ArrayC++ PythonO(n)O(1)MediumPrefix Sum
2643Row With Maximum OnesC++ PythonO(m * n)O(1)EasyArray
2644Find the Maximum Divisibility ScoreC++ PythonO(n * d)O(1)EasyBrute force
2655Find Maximal Uncovered RangesC++ PythonO(nlogn)O(n)Medium🔒, variant of Merge IntervalsSort, Line Sweep
2660Determine the Winner of a Bowling GameC++ PythonO(n)O(1)MediumArray
2672Number of Adjacent Elements With the Same ColorC++ PythonO(n + q)O(n)MediumArray
2683Neighboring Bitwise XORC++ PythonO(n)O(1)MediumArray
2711Difference of Number of Distinct Values on DiagonalsC++ PythonO(m * n)O(min(m, n))MediumPrefix Sum
2717Semi-Ordered PermutationC++ PythonO(n)O(1)EasyArray
2733Neither Minimum nor MaximumC++ PythonO(n)O(1)EasyArray
2760Longest Even Odd Subarray With ThresholdC++ PythonO(n)O(1)EasyArray
2765Longest Alternating SubarrayC++ PythonO(n)O(1)EasyArray
2782Number of Unique CategoriesC++ PythonO(n^2)O(1)Medium🔒Brute Force
2798Number of Employees Who Met the TargetC++ PythonO(n)O(1)EasyArray
2848Points That Intersect With CarsC++ PythonO(nlogn)O(1)EasySort, Line Sweep
2855Minimum Right Shifts to Sort the ArrayC++ PythonO(n)O(1)EasyArray
2873Maximum Value of an Ordered Triplet IC++ PythonO(n)O(1)EasyArray
2874Maximum Value of an Ordered Triplet IIC++ PythonO(n)O(1)EasyArray
2903Find Indices With Index and Value Difference IC++ PythonO(n)O(1)EasyPrefix Sum
2905Find Indices With Index and Value Difference IIC++ PythonO(n)O(1)MediumPrefix Sum
2906Construct Product MatrixC++ PythonO(m * n)O(m * n)MediumPrefix Sum
2908Minimum Sum of Mountain Triplets IC++ PythonO(n)O(n)EasyPrefix Sum
2909Minimum Sum of Mountain Triplets IIC++ PythonO(n)O(n)MediumPrefix Sum
2923Find Champion IC++ PythonO(n^2)O(1)EasyArray
2946Matrix Similarity After Cyclic ShiftsC++ PythonO(m * n)O(1)EasyArray
2951Find the PeaksC++ PythonO(n)O(1)EasyArray
2965Find Missing and Repeated ValuesC++ PythonO(n^2)O(1)EasyArray, Freq Table, Bit Manipulation
2966Divide Array Into Arrays With Max DifferenceC++ PythonO(nlogn)O(1)MediumSort, Array
3000Maximum Area of Longest Diagonal RectangleC++ PythonO(n)O(1)EasyArray
3009Maximum Number of Intersections on the ChartC++ PythonO(nlogn)O(n)Hard🔒Sort, Line Sweep, Coordinate Compression
3010Divide an Array Into Subarrays With Minimum Cost IC++ PythonO(n)O(1)EasyArray, Quick Select
3015Count the Number of Houses at a Certain Distance IC++ PythonO(n)O(n)MediumMath, Prefix Sum, Difference Array
3017Count the Number of Houses at a Certain Distance IIC++ PythonO(n)O(1)HardMath, Prefix Sum, Difference Array
3026Maximum Good Subarray SumC++ PythonO(n)O(n)MediumPrefix Sum
3028Ant on the BoundaryC++ PythonO(n)O(1)EasyPrefix Sum
3030Find the Grid of Region AverageC++ PythonO(m * n)O(m * n)MediumArray
3033Modify the MatrixC++ PythonO(m * n)O(1)EasyArray
3038Maximum Number of Operations With the Same Score IC++ PythonO(n)O(1)EasyArray
3065Minimum Operations to Exceed Threshold Value IC++ PythonO(n)O(1)EasyArray
3069Distribute Elements Into Two Arrays IC++ PythonO(n)O(n)EasyArray
3070Count Submatrices with Top-Left Element and Sum Less Than kC++ PythonO(n * m)O(1)MediumArray, Prefix Sum
3071Minimum Operations to Write the Letter Y on a GridC++ PythonO(n^2)O(1)MediumArray
3079Find the Sum of Encrypted IntegersC++ PythonO(nlogr)O(1)EasyArray
3096Minimum Levels to Gain More PointsC++ PythonO(n)O(n)MediumPrefix Sum
3105Longest Strictly Increasing or Strictly Decreasing SubarrayC++ PythonO(n)O(1)EasyArray
3127Make a Square with the Same ColorC++ PythonO((n - w + 1)^2 * w^2)O(1)EasyArray
3131Find the Integer Added to Array IC++ PythonO(n)O(1)EasyArray
3142Check if Grid Satisfies ConditionsC++ PythonO(m * n)O(1)EasyArray
3147Taking Maximum Energy From the Mystic DungeonC++ PythonO(n)O(1)MediumArray
3151Special Array IC++ PythonO(n)O(1)EasyArray
3152Special Array IIC++ PythonO(n + q)O(n)MediumPrefix Sum
3153Sum of Digit Differences of All PairsC++ PythonO(nlogr)O(10 * logr)MediumPrefix Sum
3159Find Occurrences of an Element in an ArrayC++ PythonO(n + q)O(n)MediumArray
3173Bitwise OR of Adjacent ElementsC++ PythonO(n)O(1)Easy🔒Array
3187Peaks in ArrayC++ PythonO(n + qlogn)O(n)HardBIT, Fenwick Tree
3195Find the Minimum Area to Cover All Ones IC++ PythonO(n * m)O(1)MediumArray
3224Minimum Array Changes to Make Differences EqualC++ PythonO(n + k)O(k)MediumPrefix Sum, Difference Array
3279Maximum Total Area Occupied by PistonsC++ PythonO(h)O(h)Hard🔒Line Sweep, Difference Array


String

#TitleSolutionTimeSpaceDifficultyTagNote
2042Check if Numbers Are Ascending in a SentenceC++ PythonO(n)O(1)Easy
2047Number of Valid Words in a SentenceC++ PythonO(n)O(1)Easy
2048Next Greater Numerically Balanced NumberC++ PythonO(1)O(1)MediumPermutations, Precompute, Binary Search
2081Sum of k-Mirror NumbersC++ PythonO(10^6)O(1)HardString, Palindrome, Brute Force
2103Rings and RodsC++ PythonO(n)O(1)Easy
2108Find First Palindromic String in the ArrayC++ PythonO(n)O(1)Easy
2109Adding Spaces to a StringC++ PythonO(n)O(1)MediumInplace
2114Maximum Number of Words Found in SentencesC++ PythonO(n)O(1)Easy
2116Check if a Parentheses String Can Be ValidC++ PythonO(n)O(1)Medium
2124Check if All A's Appears Before All B'sC++ PythonO(n)O(1)Easy
2129Capitalize the TitleC++ PythonO(n)O(1)Easy
2131Longest Palindrome by Concatenating Two Letter WordsC++ PythonO(n)O(n)Medium
2135Count Words Obtained After Adding a LetterC++ PythonO(n)O(n)MediumBitmasks
2138Divide a String Into Groups of Size kC++ PythonO(n)O(1)Easy
2156Find Substring With Given Hash ValueC++ PythonO(n)O(1)MediumRabin-Karp Algorithm, Rolling Hash
2157Groups of StringsC++ PythonO(26 * n)O(26 * n)HardBitmasks, Union Find
2168Unique Substrings With Equal Digit FrequencyC++ PythonO(n^2)O(n^2)Medium🔒Rabin-Karp Algorithm, Rolling Hash
2185Counting Words With a Given PrefixC++ PythonO(n * p)O(1)Easy
2186Minimum Number of Steps to Make Two Strings Anagram IIC++ PythonO(n)O(1)Mediumvariant of Minimum Number of Steps to Make Two Strings Anagram
2211Count Collisions on a RoadC++ PythonO(n)O(1)MediumCounting, Simulation
2213Longest Substring of One Repeating CharacterC++ PythonO(nlogn)O(n)HardSegment Tree
2223Sum of Scores of Built StringsC++ PythonO(n)O(n)HardZ-Function
2232Minimize Result by Adding Parentheses to ExpressionC++ PythonO(n^2)O(1)MediumBrute Force
2243Calculate Digit Sum of a StringC++ PythonO(n)O(n)EasySimulation
2255Count Prefixes of a Given StringC++ PythonO(n * l)O(1)EasyString
2264Largest 3-Same-Digit Number in StringC++ PythonO(n)O(1)EasyString
2269Find the K-Beauty of a NumberC++ PythonO(logn)O(logn)EasySliding Window
2272Substring With Largest VarianceC++ PythonO(a^2 * n)O(a)HardKadane's Algorithm
2273Find Resultant Array After Removing AnagramsC++ PythonO(n * l)O(1)EasyFreq Table, Sort
2278Percentage of Letter in StringC++ PythonO(n)O(1)EasyString
2288Apply Discount to PricesC++ PythonO(n)O(1)MediumString
2299Strong Password Checker IIC++ PythonO(n)O(1)EasyString
2301Match Substring After ReplacementC++ PythonO(n * k)O(m)HardBrute Force
2315Count AsterisksC++ PythonO(n)O(1)EasyString
2381Shifting Letters IIC++ PythonO(n)O(n)MediumLine Sweep
2390Removing Stars From a StringC++ PythonO(n)O(n)MediumString, Stack
2414Length of the Longest Alphabetical Continuous SubstringC++ PythonO(n)O(1)MediumString
2416Sum of Prefix Scores of StringsC++ PythonO(n * l)O(t)HardTrie
2490Circular SentenceC++ PythonO(n)O(1)EasyString
2496Maximum Value of a String in an ArrayC++ PythonO(n * l)O(1)EasyString
2575Find the Divisibility Array of a StringC++ PythonO(n)O(1)MediumPrefix Sum
2586Count the Number of Vowel Strings in RangeC++ PythonO(n)O(1)MediumString
2678Number of Senior CitizensC++ PythonO(n)O(1)EasyString
2710Remove Trailing Zeros From a StringC++ PythonO(n)O(1)EasyString
2729Check if The Number is FascinatingC++ PythonO(logn)O(1)EasyString, Bitmasks
2788Split Strings by SeparatorC++ PythonO(n * l)O(l)EasyString
2800Shortest String That Contains Three StringsC++ PythonO(l)O(l)MediumString, Brute Force, Longest Prefix Suffix, KMP Algorithm
2810Faulty KeyboardC++ PythonO(n)O(n)EasyString, Deque
2828Check if a String Is an Acronym of WordsC++ PythonO(n)O(1)EasyString
2843Count Symmetric IntegersC++ PythonO(rlogr)O(r)EasyString, Brute Force, Memoization
2851String TransformationC++ PythonO(n + logk)O(n)HardDP, Matrix Exponentiation, Math, Z-Function, KMP Algorithm
2937Make Three Strings EqualC++ PythonO(n)O(1)EasyString
2942Find Words Containing CharacterC++ PythonO(n * l)O(1)EasyString
2967Minimum Cost to Make Array EqualindromicC++ PythonO(n + logr)O(logr)Mediumvariant of Find the Closest PalindromeSort, Quick Select, Math, String
3019Number of Changing KeysC++ PythonO(n)O(1)EasyString
3023Find Pattern in Infinite Stream IC++ PythonO(p + n)O(p)Medium🔒String, KMP Algorithm
3029Minimum Time to Revert Word to Initial State IC++ PythonO(n)O(n)MediumString, Z-Function, Brute Force
3031Minimum Time to Revert Word to Initial State IIC++ PythonO(n)O(n)HardString, Z-Function
3034Number of Subarrays That Match a Pattern IC++ PythonO(n)O(m)MediumBrute Force, String, KMP Algorithm
3036Number of Subarrays That Match a Pattern IIC++ PythonO(n)O(m)HardString, KMP Algorithm
3037Find Pattern in Infinite Stream IIC++ PythonO(p + n)O(p)Hard🔒String, KMP Algorithm
3042Count Prefix and Suffix Pairs IC++ PythonO(n * l)O(t)EasyTrie, Brute Force
3043Find the Length of the Longest Common PrefixC++ PythonO((n + m) * l)O(t)MediumTrie, Hash Table
3045Count Prefix and Suffix Pairs IIC++ PythonO(n * l)O(t)HardTrie
3076Shortest Uncommon Substring in an ArrayC++ PythonO(n * l^2)O(t)MediumTrie
3093Longest Common Suffix QueriesC++ PythonO((n + q) * l)O(t)HardTrie
3110Score of a StringC++ PythonO(n)O(1)EasyString
3136Valid WordC++ PythonO(n)O(1)EasyString
3163String Compression IIIC++ PythonO(n)O(1)MediumString
3210Find the Encrypted StringC++ PythonO(n)O(1)MediumString
3271Hash Divided StringC++ PythonO(n)O(1)MediumString
3280Convert Date to BinaryC++ PythonO(1)O(1)EasyString


Linked List

#TitleSolutionTimeSpaceDifficultyTagNote
2058Find the Minimum and Maximum Number of Nodes Between Critical PointsC++ PythonO(n)O(1)Medium
2074Reverse Nodes in Even Length GroupsC++ PythonO(n)O(1)Medium
2095Delete the Middle Node of a Linked ListC++ PythonO(n)O(1)MediumTwo Pointers
2130Maximum Twin Sum of a Linked ListC++ PythonO(n)O(1)MediumTwo Pointers
2181Merge Nodes in Between ZerosC++ PythonO(n)O(1)MediumTwo Pointers
2487Remove Nodes From Linked ListC++ PythonO(n)O(n)MediumMono Stack
2674Split a Circular Linked ListC++ PythonO(n)O(1)Medium🔒Two Pointers, Slow and Fast Pointers
2807Insert Greatest Common Divisors in Linked ListC++ PythonO(n)O(1)MediumLinked List
2816Double a Number Represented as a Linked ListC++ PythonO(n)O(1)MediumLinked List
3062Winner of the Linked List GameC++ PythonO(n)O(1)Easy🔒Linked List
3063Linked List FrequencyC++ PythonO(n)O(1)Medium🔒Linked List
3217Delete Nodes From Linked List Present in ArrayC++ PythonO(n)O(m)MediumHash Table, Linked List
3263Convert Doubly Linked List to Array IC++ PythonO(n)O(1)Easy🔒Linked List


Stack

#TitleSolutionTimeSpaceDifficultyTagNote
2104Sum of Subarray RangesC++ PythonO(n)O(n)MediumMono Stack
2197Replace Non-Coprime Numbers in ArrayC++ PythonO(nlogm)O(1)HardStack, Math
2281Sum of Total Strength of WizardsC++ PythonO(n)O(n)Hardvariant of Largest Rectangle in HistogramMono Stack, Prefix Sum
2282Number of People That Can Be Seen in a GridC++ PythonO(m * n)O(m + n)Medium🔒, variant of Number of Visible People in a QueueMono Stack
2334Subarray With Elements Greater Than Varying ThresholdC++ PythonO(n)O(n)Hardvariant of Maximum Subarray Min-ProductMono Stack
2355Maximum Number of Books You Can TakeC++ PythonO(n)O(n)Hard🔒Mono Stack, Math
2454Next Greater Element IVC++ PythonO(n)O(n)HardMono Stack
2696Minimum String Length After Removing SubstringsC++ PythonO(n)O(n)EasyStack
2735Collecting ChocolatesC++ PythonO(n)O(n)MediumMono Stack, Difference Array, Prefix Sum, Binary Search, Mono Deque, Brute Force
2736Maximum Sum QueriesC++ PythonO(nlogn + mlogm + mlogn)O(n + m)HardSort, Mono Stack, Binary Search
2764is Array a Preorder of Some ‌Binary TreeC++ PythonO(n)O(n)Medium🔒Stack
2832Maximal Range That Each Element Is Maximum in ItC++ PythonO(n)O(n)Medium🔒Mono Stack
2863Maximum Length of Semi-Decreasing SubarraysC++ PythonO(n)O(n)Medium🔒Sort, Mono Stack
2865Beautiful Towers IC++ PythonO(n)O(n)MediumMono Stack
2866Beautiful Towers IIC++ PythonO(n)O(n)MediumMono Stack
2899Last Visited IntegersC++ PythonO(n)O(n)EasyStack
3113Find the Number of Subarrays Where Boundary Elements Are MaximumC++ PythonO(n)O(n)HardMono Stack, Combinatorics
3174Clear DigitsC++ PythonO(n)O(1)EasyStack, Two Pointers


Queue

#TitleSolutionTimeSpaceDifficultyTagNote
2398Maximum Number of Robots Within BudgetC++ PythonO(n)O(n)HardMono Deque, Sliding Window, Two Pointers


Binary Heap

#TitleSolutionTimeSpaceDifficultyTagNote
2054Two Best Non-Overlapping EventsC++ PythonO(nlogn)O(n)MediumLine Sweep, Heap
2163Minimum Difference in Sums After Removal of ElementsC++ PythonO(nlogn)O(n)HardHeap, Prefix Sum
2208Minimum Operations to Halve Array SumC++ PythonO(nlogn)O(n)MediumHeap
2386Find the K-Sum of an ArrayC++ PythonO(nlogn + klogk)O(n + k)HardBFS, Heap
2402Meeting Rooms IIIC++ PythonO(mlogm + n + mlogn)O(n)HardHeap
2462Total Cost to Hire K WorkersC++ PythonO(c + klogc)O(c)MediumHeap, Two Pointers
2519Count the Number of K-Big IndicesC++ PythonO(nlogk)O(n)Hard🔒Heap, Ordered Set, Sorted List
2530Maximal Score After Applying K OperationsC++ PythonO(n + klogn)O(1)MediumHeap, Simulation
2558Take Gifts From the Richest PileC++ PythonO(n + klogn)O(1)EasyHeap, Simulation
2818Apply Operations to Maximize ScoreC++ PythonO(sqrt(r) + n * (logr + sqrt(r)/log(sqrt(r))) + klogn)O(sqrt(r) + n)HardNumber Theory, Linear Sieve of Eratosthenes, Mono Stack, Greedy, Sort, Heap
3066Minimum Operations to Exceed Threshold Value IIC++ PythonO(nlogn)O(n)MediumSimulation, Heap
3080Mark Elements on Array by Performing QueriesC++ PythonO(q + nlogn)O(n)MediumHash Table, Heap
3092Most Frequent IDsC++ PythonO(nlogn)O(n)MediumHeap, BST, Sorted List
3256Maximum Value Sum by Placing Three Rooks IC++ PythonO(m * n)O(m + n)HardHeap, Brute Force
3257Maximum Value Sum by Placing Three Rooks IIC++ PythonO(m * n)O(m + n)HardHeap, Brute Force
3275K-th Nearest Obstacle QueriesC++ PythonO(qlogk)O(k)MediumHeap


Tree

#TitleSolutionTimeSpaceDifficultyTagNote
2003Smallest Missing Genetic Value in Each SubtreeC++ PythonO(n)O(n)HardDFS, Stack
2096Step-By-Step Directions From a Binary Tree Node to AnotherC++ PythonO(n)O(h)MediumDFS, Stack
2179Count Good Triplets in an ArrayC++ PythonO(nlogn)O(n)Hardvariant of Create Sorted Array through InstructionsBIT, Fenwick Tree
2196Create Binary Tree From DescriptionsC++ PythonO(n)O(n)Medium
2236Root Equals Sum of ChildrenC++ PythonO(1)O(1)EasyTree
2277Closest Node to Path in TreeC++ PythonO(n + q)O(n + q)Hard🔒Tree, BFS, Binary Lifting, Tarjan's Offline LCA Algorithm
2421Number of Good PathsC++ PythonO(nlogn)O(n)HardSort, Union Find
2509Cycle Length Queries in a TreeC++ PythonO(q * n)O(1)HardTree, LCA
2846Minimum Edge Weight Equilibrium Queries in a TreeC++ PythonO(r * (n + q))O(r * n + q)HardTree, Binary Lifting, Tarjan's Offline LCA Algorithm
3109Find the Index of PermutationC++ PythonO(nlogn)O(n)🔒, Mediumvariant of Count of Smaller Numbers After SelfBIT, Fenwick Tree, Combinatorics


Hash Table

#TitleSolutionTimeSpaceDifficultyTagNote
2006Count Number of Pairs With Absolute Difference KC++ PythonO(n)O(n)Easyvariant of Two Sum
2023Number of Pairs of Strings With Concatenation Equal to TargetC++ PythonO(n * l)O(n)Mediumvariant of Two Sum
2025Maximum Number of Ways to Partition an ArrayC++ PythonO(n)O(n)HardPrefix Sum
2032Two Out of ThreeC++ PythonO(n)O(min(n, r))EasyCounting
2053Kth Distinct String in an ArrayC++ PythonO(n)O(n)Easy
2068Check Whether Two Strings are Almost EquivalentC++ PythonO(n)O(1)Easy
2085Count Common Words With One OccurrenceC++ PythonO(m + n)O(m + n)Easy
2120Execution of All Suffix Instructions Staying in a GridC++ PythonO(m)O(m)Medium
2150Find All Lonely Numbers in the ArrayC++ PythonO(n)O(n)Medium
2154Keep Multiplying Found Values by TwoC++ PythonO(n)O(n)Easy
2170Minimum Operations to Make the Array AlternatingC++ PythonO(n)O(n)MediumFreq Table
2190Most Frequent Number Following Key In an ArrayC++ PythonO(n)O(n)EasyFreq Table
2201Count Artifacts That Can Be ExtractedC++ PythonO(a + d)O(d)MediumHash Table
2206Divide Array Into Equal PairsC++ PythonO(n)O(n)EasyHash Table
2215Find the Difference of Two ArraysC++ PythonO(n)O(n)EasyHash Table
2225Find Players With Zero or One LossesC++ PythonO(nlogn)O(n)MediumHash Table, Sort
2229Check if an Array Is ConsecutiveC++ PythonO(n)O(n)Easy🔒Hash Table, Sort
2260Minimum Consecutive Cards to Pick UpC++ PythonO(n)O(n)MediumHash Table
2261K Divisible Elements SubarraysC++ PythonO(n^2)O(t)MediumTrie, Rabin-Karp Algorithm
2283Check if Number Has Equal Digit Count and Digit ValueC++ PythonO(n)O(1)EasyFreq Table
2284Sender With Largest Word CountC++ PythonO(n * l)O(n)MediumFreq Table
2287Rearrange Characters to Make Target StringC++ PythonO(n + m)O(1)EasyFreq Table
2295Replace Elements in an ArrayC++ PythonO(n + m)O(n)MediumHash Table
2306Naming a CompanyC++ PythonO(26 * n * l)O(n * l)HardHash Table, Math
2309Greatest English Letter in Upper and Lower CaseC++ PythonO(n)O(1)EasyFreq Table, Hash Table
2325Decode the MessageC++ PythonO(n + m)O(1)EasyString, Hash Table
2341Maximum Number of Pairs in ArrayC++ PythonO(n)O(r)EasyFreq Table
2342Max Sum of a Pair With Equal Sum of DigitsC++ PythonO(nlogr)O(n)MediumHash Table, Greedy
2347Best Poker HandC++ PythonO(1)O(1)EasyFreq Table
2351First Letter to Appear TwiceC++ PythonO(n)O(1)EasyString, Hash Table
2352Equal Row and Column PairsC++ PythonO(n^2)O(n^2)MediumHash Table
2354Number of Excellent PairsC++ PythonO(n)O(n)HardBit Manipulation, Sort, Two Pointers, Freq Table, Combinatorics
2357Make Array Zero by Subtracting Equal AmountsC++ PythonO(n)O(n)EasyHash Table
2363Merge Similar ItemsC++ PythonO((m + n) * log(m + n))O(m + n)EasyFreq Table, Sort
2364Count Number of Bad PairsC++ PythonO(n)O(n)Mediumvariant of Count Nice Pairs in an ArrayHash Table
2365Task Scheduler IIC++ PythonO(n)O(n)MediumHash Table
2367Number of Arithmetic TripletsC++ PythonO(n)O(n)EasyHash Table
2374Node With Highest Edge ScoreC++ PythonO(n)O(n)MediumHash Table
2395Find Subarrays With Equal SumC++ PythonO(n)O(n)EasyHash Table
2399Check Distances Between Same LettersC++ PythonO(n)O(1)EasyHash Table
2404Most Frequent Even ElementC++ PythonO(n)O(n)EasyFreq Table
2423Remove Letter To Equalize FrequencyC++ PythonO(n)O(1)EasyBrute Force, Freq Table
2441Largest Positive Integer That Exists With Its NegativeC++ PythonO(n)O(n)EasyHash Table
2442Count Number of Distinct Integers After Reverse OperationsC++ PythonO(nlogr)O(n)MediumHash Table
2451Odd String DifferenceC++ PythonO(m * n)O(1)EasyFreq Table
2452Words Within Two Edits of DictionaryC++ PythonO(25 * l * (n + q))O(25 * l * n)Mediumvariant of MHC2022 - Round 3Brute Force, Hash
2453Destroy Sequential TargetsC++ PythonO(n)O(s)MediumFreq Table
2456Most Popular Video CreatorC++ PythonO(n)O(n)MediumHash Table
2484Count Palindromic SubsequencesC++ PythonO(100 * n)O(100 * n)HardFreq Table, Prefix Sum, DP
2488Count Subarrays With Median KC++ PythonO(n)O(n)HardFreq Table, Prefix Sum
2489Number of Substrings With Fixed RatioC++ PythonO(n)O(n)Medium🔒Freq Table, Prefix Sum
2491Divide Players Into Teams of Equal SkillC++ PythonO(n)O(n)MediumFreq Table
2501Longest Square Streak in an ArrayC++ PythonO(nlogn)O(n)MediumHash Table, DP
2506Count Pairs Of Similar StringsC++ PythonO(n * l)O(n)EasyFreq Table, Bitmask
2531Make Number of Distinct Characters EqualC++ PythonO(m + n)O(1)MediumFreq Table
2564Substring XOR QueriesC++ PythonO(n * logr + q)O(min(n * logr, r))MediumHash Table
2588Count the Number of Beautiful SubarraysC++ PythonO(n)O(n)MediumFreq Table, Combinatorics
2592Maximize Greatness of an ArrayC++ PythonO(n)O(n)MediumFreq Table, Contructive Algorithms, Sort, Greedy, Two Pointers
2598Smallest Missing Non-negative Integer After OperationsC++ PythonO(n)O(k)MediumFreq Table
2605Form Smallest Number From Two Digit ArraysC++ PythonO(m + n)O(m + n)EasyHash Table
2615Sum of DistancesC++ PythonO(n)O(n)MediumFreq Table, Prefix Sum
2657Find the Prefix Common Array of Two ArraysC++ PythonO(n)O(n)MediumFreq Table
2661First Completely Painted Row or ColumnC++ PythonO(m * n)O(m * n)MediumHash Table
2670Find the Distinct Difference ArrayC++ PythonO(n)O(n)EasyHash Table, Prefix Sum
2716Minimize String LengthC++ PythonO(n)O(1)EasyHash Table
2718Sum of Matrix After QueriesC++ PythonO(n + q)O(n)MediumHash Table
2744Find Maximum Number of String PairsC++ PythonO(n)O(1)EasyHash Table
2748Number of Beautiful PairsC++ PythonO(nlogr)O(1)EasyNumber Theory, Freq Table
2766Relocate MarblesC++ PythonO(nlogn)O(n)MediumHash Table, Sort
2768Number of Black BlocksC++ PythonO(c)O(c)MediumFreq Table
2784Check if Array is GoodC++ PythonO(n)O(n)EasyFreq Table
2808Minimum Seconds to Equalize a Circular ArrayC++ PythonO(n)O(n)MediumHash Table
2815Max Pair Sum in an ArrayC++ PythonO(nlogr)O(1)EasyHash Table
2839Check if Strings Can be Made Equal With Operations IC++ PythonO(1)O(1)EasyBrute Force, Freq Table
2840Check if Strings Can be Made Equal With Operations IIC++ PythonO(1)O(1)MediumFreq Table
2845Count of Interesting SubarraysC++ PythonO(n)O(m)MediumFreq Table, Prefix Sum
2857Count Pairs of Points With Distance kC++ PythonO(n * k)O(n)MediumFreq Table
2869Minimum Operations to Collect ElementsC++ PythonO(n)O(k)EasyHash Table
2943Maximize Area of Square Hole in GridC++ PythonO(h + v)O(h + v)MediumArray, Sort, Hash Table
2947Count Beautiful Substrings IC++ PythonO(n + sqrt(k))O(n)MediumBrute Force, Number Theory, Prefix Sum, Freq Table
2949Count Beautiful Substrings IIC++ PythonO(n + sqrt(k))O(n)HardBrute Force, Number Theory, Prefix Sum, Freq Table
2950Number of Divisible SubstringsC++ PythonO(d * n)O(n)Medium🔒Prefix Sum, Freq Table
2955Number of Same-End SubstringsC++ PythonO(26 * (n + q))O(26 * n)Medium🔒Freq Table, Prefix Sum
2956Find Common Elements Between Two ArraysC++ PythonO(n + m)O(n + m)EasyHash Table
2964Number of Divisible Triplet SumsC++ PythonO(n^2)O(n)Medium🔒Freq Table
2975Maximum Square Area by Removing Fences From a FieldC++ PythonO(h^2 + v^2)O(min(h, v)^2)MediumHash Table
2981Find Longest Special Substring That Occurs Thrice IC++ PythonO(26 * 3 + n * 3)O(26 * 3)MediumString, Brute Force, Freq Table, Hash Table
2982Find Longest Special Substring That Occurs Thrice IIC++ PythonO(26 * 3 + n * 3)O(26 * 3)MediumString, Hash Table
2983Palindrome Rearrangement QueriesC++ PythonO(26 + d * n + d * q)O(26 + d * n)HardPrefix Sum, Freq Table
2996Smallest Missing Integer Greater Than Sequential Prefix SumC++ PythonO(n)O(n)EasyHash Table
3005Count Elements With Maximum FrequencyC++ PythonO(n)O(n)EasyFreq Table
3039Apply Operations to Make String EmptyC++ PythonO(n)O(1)MediumFreq Table
3044Most Frequent PrimeC++ Pythonprecompute: O(10^MAX_N_M)
runtime: O(n * m * (n + m))
O(10^MAX_N_M + n * m * (n + m))MediumNumber Theory, Linear Sieve of Eratosthenes, Freq Table
3046Split the ArrayC++ PythonO(n)O(n)EasyFreq Table
3078Match Alphanumerical Pattern in Matrix IC++ PythonO(n * m * r * c)O(1)Medium🔒Brute Force, Hash Table
3083Existence of a Substring in a String and Its ReverseC++ PythonO(n)O(min(n, 26^2))EasyHash Table
3120Count the Number of Special Characters IC++ PythonO(n + 26)O(26)EasyHash Table
3121Count the Number of Special Characters IIC++ PythonO(n + 26)O(26)MediumHash Table
3137Minimum Number of Operations to Make Word K-PeriodicC++ PythonO(n)O(n)MediumFreq Table
3138Minimum Length of Anagram ConcatenationC++ PythonO(sqrt(n) * n + 26 * nlogn)O(26)MediumNumber Theory, Freq Table
3143Maximum Points Inside the SquareC++ PythonO(n + 26)O(26)MediumHash Table
3146Permutation Difference between Two StringsC++ PythonO(n + 26)O(26)EasyHash Table
3158Find the XOR of Numbers Which Appear TwiceC++ PythonO(n)O(n)EasyHash Table
3160Find the Number of Distinct Colors Among the BallsC++ PythonO(q)O(q)MediumFreq Table
3167Better Compression of StringC++ PythonO(n + 26)O(26)Medium🔒Freq Table, Counting Sort
3184Count Pairs That Form a Complete Day IC++ PythonO(n + 24)O(24)EasyFreq Table
3185Count Pairs That Form a Complete Day IIC++ PythonO(n + 24)O(24)MediumFreq Table
3223Minimum Length of String After OperationsC++ PythonO(n + 26)O(26)MediumFreq Table
3237Alt and Tab SimulationC++ PythonO(n)O(n)Medium🔒Hash Table
3238Find the Number of Winning PlayersC++ PythonO(p)O(min(n * c, p)EasyFreq Table
3245Alternating Groups IIIC++ PythonO(nlogn + qlogn)O(n)HardBST, Sorted List, Freq Table, BIT, Fenwick Tree


Math

#TitleSolutionTimeSpaceDifficultyTagNote
2001Number of Pairs of Interchangeable RectanglesC++ PythonO(n)O(n)MediumMath
2005Subtree Removal Game with Fibonacci TreeC++ PythonO(1)O(1)Hard🔒Math, Sprague-Grundy Theorem, Colon Principle
2028Find Missing ObservationsC++ PythonO(n)O(1)Medium
2029Stone Game IXC++ PythonO(n)O(1)Medium
2063Vowels of All SubstringsC++ PythonO(n)O(1)MediumCombinatorics
2073Time Needed to Buy TicketsC++ PythonO(n)O(1)EasySimulation, Math
2083Substrings That Begin and End With the Same LetterC++ PythonO(n)O(1)Medium🔒Combinatorics
2091Removing Minimum and Maximum From ArrayC++ PythonO(n)O(1)MediumMath
2110Number of Smooth Descent Periods of a StockC++ PythonO(n)O(1)MediumMath, Combinatorics
2117Abbreviating the Product of a RangeC++ PythonO(r - l)O(1)HardMath
2119A Number After a Double ReversalC++ PythonO(1)O(1)EasyMath
2125Number of Laser Beams in a BankC++ PythonO(m * n)O(1)MediumMath
2133Check if Every Row and Column Contains All NumbersC++ PythonO(n^2)O(n)EasyMath
2145Count the Hidden SequencesC++ PythonO(n)O(1)MediumMath
2148Count Elements With Strictly Smaller and Greater ElementsC++ PythonO(n)O(1)EasyMath
2152Minimum Number of Lines to Cover PointsC++ PythonO(n * 2^n)O(n^2)Medium🔒Math, Hash Table, Bitmasks
2169Count Operations to Obtain ZeroC++ PythonO(log(min(m, n)))O(1)EasyMath, Euclidean Algorithm
2171Removing Minimum Number of Magic BeansC++ PythonO(nlogn)O(1)MediumMath, Sort
2176Count Equal and Divisible Pairs in an ArrayC++ PythonO(nlogk + n * sqrt(k))O(n + sqrt(k))EasyMath
2177Find Three Consecutive Integers That Sum to a Given NumberC++ PythonO(1)O(1)MediumMath
2180Count Integers With Even Digit SumC++ PythonO(logn)O(1)EasyMath
2183Count Array Pairs Divisible by KC++ PythonO(nlogk + k)O(sqrt(k))Hardvariant of Count Equal and Divisible Pairs in an ArrayMath
2198Number of Single Divisor TripletsC++ PythonO(d^3)O(d)Medium🔒Math, Combinatorics
2217Find Palindrome With Fixed LengthC++ PythonO(n * l)O(1)MediumMath
2221Find Triangular Sum of an ArrayC++ PythonO(n)O(1)MediumSimulation, Combinatorics, Number Thoery
2235Add Two IntegersC++ PythonO(1)O(1)EasyMath
2240Number of Ways to Buy Pens and PencilsC++ PythonO(sqrt(t))O(1)MediumMath
2244Minimum Rounds to Complete All TasksC++ PythonO(n)O(n)MediumMath, Freq Table
2249Count Lattice Points Inside a CircleC++ PythonO(n * r^2)O(min(n * r^2, max_x * max_y))MediumMath, Hash Table
2262Total Appeal of A StringC++ PythonO(n)O(26)Hardvariant of Count Unique Characters of All Substrings of a Given StringCombinatorics
2280Minimum Lines to Represent a Line ChartC++ PythonO(nlogn)O(1)MediumSort, Math, GCD
2310Sum of Numbers With Units Digit KC++ PythonO(1)O(1)MediumMath
2338Count the Number of Ideal ArraysC++ PythonO(sqrt(m) + n + m * (logm + sqrt(m)/log(sqrt(m))))O(sqrt(m) + n + logm)Hardvariant of Count Ways to Make Array With ProductDP, Linear Sieve of Eratosthenes, Factorization, Combinatorics
2344Minimum Deletions to Make Array DivisibleC++ PythonO(n + m + logr)O(1)HardMath, GCD
2345Finding the Number of Visible MountainsC++ PythonO(nlogn)O(1)Medium🔒Math, Sort, Mono Stack
2376Count Special IntegersC++ PythonO(logn)O(logn)Hardvariant of Numbers With Repeated DigitsCombinatorics
2396Strictly Palindromic NumberC++ PythonO(1)O(1)MediumMath
2400Number of Ways to Reach a Position After Exactly k StepsC++ PythonO(k)O(k)MediumCombinatorics
2409Count Days Spent TogetherC++ PythonO(1)O(1)EasyString, Math, Prefix Sum
2413Smallest Even MultipleC++ PythonO(1)O(1)EasyMath, Bit Manipulation
2427Number of Common FactorsC++ PythonO(log(min(a, b)) + sqrt(gcd))O(1)EasyMath
2437Number of Valid Clock TimesC++ PythonO(1)O(1)EasyCombinatorics
2450Number of Distinct Binary Strings After Applying OperationsC++ PythonO(logn)O(1)Medium🔒Combinatorics
2455Average Value of Even Numbers That Are Divisible by ThreeC++ PythonO(n)O(1)EasyMath
2468Split Message Based on LimitC++ PythonO(n + rlogr)O(1)HardBrute Force, Math
2469Convert the TemperatureC++ PythonO(1)O(1)EasyMath
2481Minimum Cuts to Divide a CircleC++ PythonO(1)O(1)EasyMath
2485Find the Pivot IntegerC++ PythonO(1)O(1)EasyMath
2514Count AnagramsC++ PythonO(n)O(n)HardMath, Combinatorics
2520Count the Digits That Divide a NumberC++ PythonO(logn)O(1)EasyMath
2521Distinct Prime Factors of Product of ArrayC++ Pythonprecompute: O(sqrt(MAX_N))
runtime: O(m + nlog(logn))
O(sqrt(MAX_N))MediumNumber Theory, Linear Sieve of Eratosthenes
2523Closest Prime Numbers in RangeC++ Pythonprecompute: O(MAX_N * log(MAX_N))
runtime: O(log(MAX_N))
O(MAX_N)MediumNumber Theory, Linear Sieve of Eratosthenes, Segment Tree
2525Categorize Box According to CriteriaC++ PythonO(1)O(1)EasyMath
2539Count the Number of Good SubsequencesC++ PythonO(26 * n)O(n)Medium🔒Combinatorics
2543Check if Point Is ReachableC++ PythonO(log(min(a, b)))O(1)HardNumber Theory
2544Alternating Digit SumC++ PythonO(logn)O(1)EasyMath
2549Count Distinct Numbers on BoardC++ PythonO(1)O(1)EasyMath
2550Count Collisions of Monkeys on a PolygonC++ PythonO(logn)O(1)MediumCombinatorics, Fast Exponentiation
2562Find the Array Concatenation ValueC++ PythonO(nlogr)O(1)EasyMath
2568Minimum Impossible ORC++ PythonO(logr)O(1)MediumMath, Hash Table, Bit Manipulations
2579Count Total Number of Colored CellsC++ PythonO(1)O(1)MediumMath
2582Pass the PillowC++ PythonO(1)O(1)MediumMath
2584Split the Array to Make Coprime ProductsC++ PythonO(n * sqrt(r))O(sqrt(r))HardMath, Number Theory
2614Prime In DiagonalC++ Pythonprecompute: O(MAX_N)
runtime: O(n)
O(MAX_N)EasyNumber Theory, Linear Sieve of Eratosthenes
2651Calculate Delayed Arrival TimeC++ PythonO(1)O(1)EasyMath
2652Sum MultiplesC++ PythonO(1)O(1)EasyMath, Principle of Inclusion and Exclusion
2656Maximum Sum With Exactly K ElementsC++ PythonO(n)O(1)EasyMath
2731Movement of RobotsC++ PythonO(nlogn)O(1)MediumSort, Math
2739Total Distance TraveledC++ PythonO(1)O(1)EasyMath
2749Minimum Operations to Make the Integer ZeroC++ PythonO(1)O(1)MediumLinear Search, Bit Manipulations, Math
2750Ways to Split Array Into Good SubarraysC++ PythonO(n)O(1)MediumCombinatorics
2761Prime Pairs With Target SumC++ PythonO(n)O(n)MediumNumber Theory, Linear Sieve of Eratosthenes
2778Sum of Squares of Special ElementsC++ PythonO(sqrt(n))O(1)EasyNumber Theory
2780Minimum Index of a Valid SplitC++ PythonO(n)O(1)MediumBoyer–Moore Majority Vote Algorithm, Linear Search
2802Find The K-th Lucky NumberC++ PythonO(logn)O(1)Medium🔒Math, Bitmasks
2806Account Balance After Rounded PurchaseC++ PythonO(1)O(1)EasyMath
2833Furthest Point From OriginC++ PythonO(1)O(1)EasyMath
2862Maximum Element-Sum of a Complete Subset of IndicesC++ PythonO(n)O(n)HardNumber Theory, Basel Problem
2861Maximum Number of AlloysC++ PythonO(k * nlogn)O(n)MediumBinary Search, Sort, Math
2894Divisible and Non-divisible Sums DifferenceC++ PythonO(1)O(1)EasyMath
2898Maximum Linear Stock ScoreC++ PythonO(n)O(n)Medium🔒Math, Freq Table
2927Distribute Candies Among Children IIIC++ PythonO(1)O(1)Hard🔒Stars and Bars, Combinatorics, Principle of Inclusion and Exclusion
2928Distribute Candies Among Children IC++ PythonO(1)O(1)EasyStars and Bars, Combinatorics, Principle of Inclusion and Exclusion, Brute Force
2929Distribute Candies Among Children IIC++ PythonO(1)O(1)MediumStars and Bars, Combinatorics, Principle of Inclusion and Exclusion, Brute Force
2930Number of Strings Which Can Be Rearranged to Contain SubstringC++ PythonO(1)O(1)MediumCombinatorics, Principle of Inclusion and Exclusion, Bitmasks, DP
2954Count the Number of Infection SequencesC++ Pythonprecompute: O(max_n)
runtime: O(s + logn)
O(max_n)HardCombinatorics
2961Double Modular ExponentiationC++ PythonO(n * (logb + logc))O(1)MediumFast Exponentiation
2963Count the Number of Good PartitionsC++ PythonO(n)O(n)HardHash Table, Combinatorics
2979Most Expensive Item That Can Not Be BoughtC++ PythonO(1)O(1)Medium🔒Frobenius Coin Problem, Chicken McNugget Theorem, DP
2999Count the Number of Powerful IntegersC++ PythonO(logf)O(1)HardMath, Combinatorics
3001Minimum Moves to Capture The QueenC++ PythonO(1)O(1)MediumMath
3007Maximum Number That Sum of the Prices Is Less Than or Equal to KC++ PythonO(max(logk, x) * log((logk) / x))O((logk) / x)MediumBit Manipulation, Binary Search, Combinatorics
3021Alice and Bob Playing Flower GameC++ PythonO(1)O(1)MediumCombinatorics
3024Type of Triangle IIC++ PythonO(1)O(1)EasyMath
3032Count Numbers With Unique Digits IIC++ PythonO(logb)O(1)Easy🔒, variant of Count Numbers With Unique DigitsBrute Force, Hash Table, Bitmasks, Combinatorics
3047Find the Largest Area of Square Inside Two RectanglesC++ PythonO(n^2)O(1)MeidumBrute Force, Math
3084Count Substrings Starting and Ending with Given CharacterC++ PythonO(n)O(1)MeidumCombinatorics
3091Apply Operations to Make Sum of Array Greater Than or Equal to kC++ PythonO(logn)O(1)MeidumCodeforces Round #674 CMath
3099Harshad NumberC++ PythonO(logx)O(1)EasyMath
3102Minimize Manhattan DistancesC++ PythonO(n)O(1)HardMath
3115Maximum Prime DifferenceC++ PythonO(r + n)O(r)MediumArray, Number Theory, Linear Sieve of Eratosthenes
3128Right TrianglesC++ PythonO(n * m)O(min(n, m))MediumArray, Combinatorics, Freq Table
3154Find Number of Ways to Reach the K-th StairC++ PythonO(logk)O(logk)HardCombinatorics
3155Maximum Number of Upgradable ServersC++ PythonO(n)O(1)Medium🔒Math
3162Find the Number of Good Pairs IC++ PythonO(rlogr + n + m)O(r)EasyBrute Force, Number Theory, Freq Table
3164Find the Number of Good Pairs IIC++ PythonO(rlogr + n + m)O(r)MediumNumber Theory, Freq Table
3178Find the Child Who Has the Ball After K SecondsC++ PythonO(1)O(1)EasyMath
3179Find the N-th Value After K SecondsC++ PythonO(n + k)O(n + k)MediumPrefix Sum, Combinatorics
3183The Number of Ways to Make the SumC++ PythonO(1)O(1)Medium🔒Math, DP
3190Find Minimum Operations to Make All Elements Divisible by ThreeC++ PythonO(n)O(1)EasyMath
3200Maximum Height of a TriangleC++ PythonO(logn)O(1)EasySimulation, Math
3222Find the Winning Player in Coin GameC++ PythonO(1)O(1)EasyMath
3227Vowels Game in a StringC++ PythonO(n)O(1)MediumMath
3232Find if Digit Game Can Be WonC++ PythonO(n)O(1)EasyBrute Force, Game Theory
3247Number of Subsequences with Odd SumC++ PythonO(n)O(1)Medium🔒Combinatorics, Fast Exponentiation, DP
3250Find the Count of Monotonic Pairs IC++ PythonO(n + r)O(n + r)HardCombinatorics, Stars and Bars, DP, Prefix Sum
3251Find the Count of Monotonic Pairs IIC++ PythonO(n + r)O(n + r)HardCombinatorics, Stars and Bars, DP, Prefix Sum
3270Find the Key of the NumbersC++ PythonO(d)O(1)EasyMath
3272Find the Count of Good IntegersC++ PythonO(n + 10 * 10^((n + 1)/2))O(n + 10 * (10 * nHr(10, n/2)))HardCombinatorics, Freq Table
3274Check if Two Chessboard Squares Have the Same ColorC++ PythonO(1)O(1)EasyMath, Parity


Sort

#TitleSolutionTimeSpaceDifficultyTagNote
2015Average Height of Buildings in Each SegmentC++ PythonO(nlogn)O(n)Medium🔒Line Sweep
2021Brightest Position on StreetC++ PythonO(nlogn)O(n)Medium🔒Line Sweep
2070Most Beautiful Item for Each QueryC++ PythonO(nlogn + qlogn)O(1)MediumSort, Binary Search
2089Find Target Indices After Sorting ArrayC++ PythonO(n)O(1)EasyCounting Sort
2158Amount of New Area Painted Each DayC++ PythonO(nlogr)O(r)Hard🔒Line Sweep, Sorted List, Heap, Segment Tree
2164Sort Even and Odd Indices IndependentlyC++ PythonO(n)O(c)EasyCounting Sort, Inplace
2191Sort the Jumbled NumbersC++ PythonO(nlogm + nlogn)O(n)MediumSort
2231Largest Number After Digit Swaps by ParityC++ PythonO(logn)O(1)EasyCounting Sort
2233Maximum Product After K IncrementsC++ PythonO(n + k)O(n)MediumHeap, Freq Table, Sort, Math
2248Intersection of Multiple ArraysC++ PythonO(n * l + r)O(l)EasyHash Table, Counting Sort
2251Number of Flowers in Full BloomC++ PythonO(nlogn + mlogn)O(n)HardLine Sweep, Binary Search
2343Query Kth Smallest Trimmed NumberC++ PythonO(q + n * t)O(t + n + q)MediumSort, Quick Select, Radix Sort
2418Sort the PeopleC++ PythonO(nlogn)O(n)EasySort
2497Maximum Star Sum of a GraphC++ PythonO(n)O(n)MediumSort, Quick Select
2512Reward Top K StudentsC++ PythonO(pf * l + nf * l + n * l + klogk)O(pf * l + nf * l + n)MediumPartial Sort, Quick Select
2545Sort the Students by Their Kth ScoreC++ PythonO(mlogm)O(1)MediumSort
2659Make Array EmptyC++ PythonO(nlogn)O(n)HardSort, BIT, Fenwick Tree
2679Sum in a MatrixC++ PythonO(m * nlogn)O(1)MediumSort
2740Find the Value of the PartitionC++ PythonO(nlogn)O(1)MediumSort
2785Sort Vowels in a StringC++ PythonO(n)O(1)MediumCounting Sort
2792Count Nodes That Are Great EnoughC++ PythonO(k * h)O(k + h)Hard🔒Merge Sort
2948Make Lexicographically Smallest Array by Swapping ElementsC++ PythonO(nlogn)O(n)MediumSort
2974Minimum Number GameC++ PythonO(nlogn)O(1)EasySort
3011Find if Array Can Be SortedC++ PythonO(n)O(1)MediumSort
3025Find the Number of Ways to Place People IC++ PythonO(n^2)O(1)MediumSort, Array
3027Find the Number of Ways to Place People IIC++ PythonO(n^2)O(1)HardSort, Array
3081Replace Question Marks in String to Minimize Its ValueC++ PythonO(n + 26 * log(26))O(n + 26)MediumGreedy, Counting Sort, Heap, Prefix Sum
3132Find the Integer Added to Array IIC++ PythonO(n)O(n)MediumSort, Paritial Sort, Freq Table
3169Count Days Without MeetingsC++ PythonO(nlogn)O(1)MediumSort
3194Minimum Average of Smallest and Largest ElementsC++ PythonO(nlogn)O(1)EasySort


Two Pointers

#TitleSolutionTimeSpaceDifficultyTagNote
2009Minimum Number of Operations to Make Array ContinuousC++ PythonO(nlogn)O(1)HardTwo Pointers, Sliding Window
2024Maximize the Confusion of an ExamC++ PythonO(n)O(1)Mediumvariant of Longest Repeating Character ReplacementSliding Window
2040Kth Smallest Product of Two Sorted ArraysC++ PythonO((m + n) * logr)O(1)HardBinary Search, Two Pointers
2046Sort Linked List Already Sorted Using Absolute ValuesC++ PythonO(n)O(1)Medium🔒Linked List
2062Count Vowel Substrings of a StringC++ PythonO(n)O(1)Easyvariant of Count Number of Nice SubarraysSliding Window
2067Number of Equal Count SubstringsC++ PythonO(n)O(1)Medium🔒Sliding Window
2090K Radius Subarray AveragesC++ PythonO(n)O(1)MediumSliding Window
2105Watering Plants IIC++ PythonO(n)O(1)MediumSimulation
2107Number of Unique Flavors After Sharing K CandiesC++ PythonO(n)O(n)Medium🔒Sliding Window
2134Minimum Swaps to Group All 1's Together IIC++ PythonO(n)O(1)MediumSliding Window
2149Rearrange Array Elements by SignC++ PythonO(n)O(1)MediumTwo Pointers
2161Partition Array According to Given PivotC++ PythonO(n)O(n)MediumTwo Pointers
2200Find All K-Distant Indices in an ArrayC++ PythonO(n)O(1)EasyTwo Pointers
2234Maximum Total Beauty of the GardensC++ PythonO(nlogn)O(1)HardSort, Prefix Sum, Greedy, Binary Search, Two Pointers
2302Count Subarrays With Score Less Than KC++ PythonO(n)O(1)HardTwo Pointers, Sliding Window
2330Valid Palindrome IVC++ PythonO(n)O(1)Medium🔒String, Two Pointers
2332The Latest Time to Catch a BusC++ PythonO(nlogn + mlogm)O(1)MediumString, Two Pointers
2337Move Pieces to Obtain a StringC++ PythonO(n + m)O(1)MediumString, Two Pointers
2348Number of Zero-Filled SubarraysC++ PythonO(n)O(1)MediumTwo Pointers, Combinatorics
2379Minimum Recolors to Get K Consecutive Black BlocksC++ PythonO(n)O(1)EasySliding Window
2393Count Strictly Increasing SubarraysC++ PythonO(n)O(1)Medium🔒Two Pointers
2401Longest Nice SubarrayC++ PythonO(n)O(1)MediumSliding Window, Two Pointers
2444Count Subarrays With Fixed BoundsC++ PythonO(n)O(1)Hardvariant of Number of Substrings Containing All Three CharactersTwo Pointers
2461Maximum Sum of Distinct Subarrays With Length KC++ PythonO(n)O(k)MediumTwo Pointers
2465Number of Distinct AveragesC++ PythonO(nlogn)O(n)EasyTwo Pointers, Hash Table
2511Maximum Enemy Forts That Can Be CapturedC++ PythonO(n)O(1)EasyArray, Two Pointers
2516Take K of Each Character From Left and RightC++ PythonO(n)O(1)MediumSliding Window, Two Pointers
2524Maximum Frequency Score of a SubarrayC++ PythonO(n)O(n)Hard🔒Sliding Window, Two Pointers, Freq Table, Hash Table
2537Count the Number of Good SubarraysC++ PythonO(n)O(n)MediumSliding Window, Two Pointers
2540Minimum Common ValueC++ PythonO(n)O(1)EasyTwo Pointers
2555Maximize Win From Two SegmentsC++ PythonO(n)O(n)MediumTwo Pointers, Sliding Window, DP
2563Count the Number of Fair PairsC++ PythonO(nlogn)O(1)MediumSort, Two Pointers
2570Merge Two 2D Arrays by Summing ValuesC++ PythonO(n)O(1)EasyTwo Pointers
2609Find the Longest Balanced Substring of a Binary StringC++ PythonO(n)O(1)EasyString, Two Pointers
2653Sliding Subarray BeautyC++ PythonO(nlogk)O(k)MediumSorted List, Ordered Set, Two Pointers
2730Find the Longest Semi-Repetitive SubstringC++ PythonO(n)O(1)MediumTwo Pointers
2743Count Substrings Without Repeating CharacterC++ PythonO(n)O(1)Medium🔒, variant of Longest Substring Without Repeating CharactersTwo Pointers, Sliding Window
2747Count Zero Request ServersC++ PythonO(nlogn + mlogm)O(n + m)HardSort, Two Pointers, Line Sweep
2762Continuous SubarraysC++ PythonO(n)O(1)MediumMono Deque, BST, Ordered Dict, Two Pointers, Sliding Window
2763Sum of Imbalance Numbers of All SubarraysC++ PythonO(n)O(n)HardTwo Pointers, Sliding Window, Hash Table, Combinatorics
2779Maximum Beauty of an Array After Applying OperationC++ PythonO(nlogn)O(1)MediumSort, Two Pointers, Sliding Window
2781Length of the Longest Valid SubstringC++ PythonO((m + n) * l)O(t)HardTwo Pointers, Sliding Window, Trie
2799Count Complete Subarrays in an ArrayC++ PythonO(n)O(n)MediumFreq Table, Two Pointers, Sliding Window
2824Count Pairs Whose Sum is Less than TargetC++ PythonO(nlogn)O(1)EasySort, Two Pointers
2831Find the Longest Equal SubarrayC++ PythonO(n)O(n)MediumFreq Table, Two Pointers, Sliding Window
2838Maximum Coins Heroes Can CollectC++ PythonO(nlogn + mlogm)O(n + m)Medium🔒Sort, Two Pointers
2841Maximum Sum of Almost Unique SubarrayC++ PythonO(n)O(n)MediumFreq Table, Two Pointers, Sliding Window
2875Minimum Size Subarray in Infinite ArrayC++ PythonO(n)O(1)MediumPrefix Sum, Hash Table, Two Pointers, Sliding Window
2904Shortest and Lexicographically Smallest Beautiful StringC++ PythonO(n^2)O(1)MediumTwo Pointers, Sliding Window
2933High-Access EmployeesC++ PythonO(nlogn)O(n)MediumSort, Two Pointers, Sliding Window
2938Separate Black and White BallsC++ PythonO(n)O(1)MediumTwo Pointers
2953Count Complete SubstringsC++ PythonO(26 + d * n)O(26)MediumFreq Table, Two Pointers, Sliding Window
2958Length of Longest Subarray With at Most K FrequencyC++ PythonO(n)O(n)MediumFreq Table, Two Pointers, Sliding Window
2962Count Subarrays Where Max Element Appears at Least K TimesC++ PythonO(n)O(1)MediumTwo Pointers, Sliding Window
2968Apply Operations to Maximize Frequency ScoreC++ PythonO(nlogn)O(1)HardSort, Two Pointers, Sliding Window, Prefix Sum, Binary Search
2970Count the Number of Incremovable Subarrays IC++ PythonO(n)O(1)EasyTwo Pointers, Brute Force
2972Count the Number of Incremovable Subarrays IIC++ PythonO(n)O(1)HardTwo Pointers
3006Find Beautiful Indices in the Given Array IC++ PythonO(n)O(min(a + b + x + y, n))MediumKMP Algorithm, Binary Search, Two Pointers
3008Find Beautiful Indices in the Given Array IIC++ PythonO(n)O(min(a + b + x + y, n))HardKMP Algorithm, Binary Search, Two Pointers
3013Divide an Array Into Subarrays With Minimum Cost IIC++ PythonO(nlogd)O(d)HardSliding Window, Heap, Freq Table, Ordered Set, BST, Sorted List
3085Minimum Deletions to Make String K-SpecialC++ PythonO(n + 26)O(n + 26)MediumFreq Table, Counting Sort, Two Pointers
3090Maximum Length Substring With Two OccurrencesC++ PythonO(n + 26)O(26)EasyFreq Table, Sliding Window, Two Pointers
3095Shortest Subarray With OR at Least K IC++ PythonO(n * 30)O(30)EasyBrute Force, Freq Table, Two Pointers
3097Shortest Subarray With OR at Least K IIC++ PythonO(n * 30)O(30)MediumFreq Table, Two Pointers
3171Find Subarray With Bitwise OR Closest to KC++ PythonO(nlogr)O(logr)Hardvariant of Find a Value of a Mysterious Function Closest to TargetDP, Freq Table, Two Pointers, Sliding Window
3206Alternating Groups IC++ PythonO(n)O(1)EasyTwo Pointers, Sliding Window
3208Alternating Groups IIC++ PythonO(n)O(1)MediumTwo Pointers, Sliding Window
3234Count the Number of Substrings With Dominant OnesC++ PythonO(n^(3/2))O(1)MediumTwo Pointers, Sliding Window
3254Find the Power of K-Size Subarrays IC++ PythonO(n)O(1)MediumTwo Pointers, Sliding Window
3255Find the Power of K-Size Subarrays IIC++ PythonO(n)O(1)MediumTwo Pointers, Sliding Window
3258Count Substrings That Satisfy K-Constraint IC++ PythonO(n)O(1)EasyTwo Pointers, Sliding Window
3261Count Substrings That Satisfy K-Constraint IIC++ PythonO(n)O(n)HardTwo Pointers, Sliding Window, Prefix Sum, Hash Table
3264Final Array State After K Multiplication Operations IC++ PythonO(nlogn)O(n)EasySort, Two Pointers, Sliding Window, Fast Exponentiation, Heap, Binary Search, Simulation
3266Final Array State After K Multiplication Operations IIC++ PythonO(nlogn)O(n)HardSort, Two Pointers, Sliding Window, Fast Exponentiation, Heap, Binary Search


Recursion

#TitleSolutionTimeSpaceDifficultyTagNote
2613Beautiful PairsC++ PythonO(n) on averageO(n)Hard🔒, variant of SPOJ - Closest Point PairRandom Algorithms, Divide and Conquer, Merge Sort, Segment Tree


Binary Search

#TitleSolutionTimeSpaceDifficultyTagNote
2064Minimized Maximum of Products Distributed to Any StoreC++ PythonO(nlogm)O(1)Mediumvariant of Minimum Limit of Balls in a Bag
2111Minimum Operations to Make the Array K-IncreasingC++ PythonO(nlog(n/k))O(n/k)Hardvariant of Longest Increasing Subsequence
2137Pour Water Between Buckets to Make Water Levels EqualC++ PythonO(nlogr)O(1)Medium🔒
2187Minimum Time to Complete TripsC++ PythonO(nlogr)O(1)Medium
2226Maximum Candies Allocated to K ChildrenC++ PythonO(nlogr)O(1)MediumBinary Search
2250Count Number of Rectangles Containing Each PointC++ PythonO(nlogn + m * max_y * logn)O(n)MediumBucket Sort, Binary Search
2300Successful Pairs of Spells and PotionsC++ PythonO(mlogm + nlogm)O(1)MediumBinary Search
2333Minimum Sum of Squared DifferenceC++ PythonO(nlogn + nlogr)O(1)MediumBinary Search
2387Median of a Row Wise Sorted MatrixC++ PythonO(logr * mlogn)O(1)Medium🔒Binary Search
2389Longest Subsequence With Limited SumC++ PythonO(nlogn + qlogn)O(1)EasyGreedy, Sort, Binary Search
2448Minimum Cost to Make Array EqualC++ PythonO(nlogn)O(n)HardMath, Binary Search, Prefix Sum
2476Closest Nodes Queries in a Binary Search TreeC++ PythonO(n + qlogn)O(n)HardDFS, Binary Search
2513Minimize the Maximum of Two ArraysC++ PythonO(log(min(d1, d2)))O(1)MediumNumber Theory, Binary Search
2517Maximum Tastiness of Candy BasketC++ PythonO(nlogr)O(1)MediumBinary Search, Greedy
2528Maximize the Minimum Powered CityC++ PythonO(nlogk)O(n)HardBinary Search, Sliding Window, Greedy
2529Maximum Count of Positive Integer and Negative IntegerC++ PythonO(logn)O(1)EasyBinary Search
2554Maximum Number of Integers to Choose From a Range IC++ PythonO(b)O(b)MediumMath, Binary Search, Prefix Sum, Greedy
2557Maximum Number of Integers to Choose From a Range IIC++ PythonO(b)O(b)Medium🔒Math, Binary Search, Prefix Sum
2560House Robber IVC++ PythonO(nlogn)O(n)MediumBinary Search, Greedy
2594Minimum Time to Repair CarsC++ PythonO(mx * (logc + log(mn)))O(mx)MediumFreq Table, Binary Search, Heap, Simulation
2602Minimum Operations to Make All Array Elements EqualC++ PythonO(nlogn + qlogn)O(n)MediumSort, Binary Search, Prefix Sum
2616Minimize the Maximum Difference of PairsC++ PythonO(nlogn + nlogr)O(1)MediumSort, Binary Search, Greedy
2702Minimum Operations to Make Numbers Non-positiveC++ PythonO(nlogr)O(1)Hard🔒Binary Search, Greedy
2936Number of Equal Numbers BlocksC++ PythonO(klogn)O(1)Medium🔒Binary Search
2940Find Building Where Alice and Bob Can MeetC++ PythonO(n + qlogn)O(n)HardHeap, Mono Stack, Binary Search, Online Solution, Segment Tree
3048Earliest Second to Mark Indices IC++ PythonO(mlogm)O(n)MediumBinary Search, Greedy
3049Earliest Second to Mark Indices IIC++ PythonO((m + nlogn) *logm)O(n)HardBinary Search, Greedy, Heap
3104Find Longest Self-Contained SubstringC++ PythonO(n + 26^3 * logn)O(n)Hard🔒Brute Force, Freq Table, Two Pointers, Hash Table, Binary Search
3116Kth Smallest Amount With Single Denomination CombinationC++ PythonO(n * 2^n * logk)O(2^n)HardBinary Search, Principle of Inclusion and Exclusion, Number Theory
3134Find the Median of the Uniqueness ArrayC++ PythonO(nlogn)O(n)HardBinary Search, Two Pointers, Sliding Window
3135Equalize Strings by Adding or Removing Characters at EndsC++ PythonO((n + m) * log(min(n, m)))O(min(n, m))Medium🔒Binary Search, Rabin-Karp Algorithm, Rolling Hash, DP
3145Find Products of Elements of Big ArrayC++ PythonO(q * (logr)^2)O(1)HardBinary Search, Combinatorics, Bitmasks, Fast Exponentiation
3231Minimum Number of Increasing Subsequence to Be RemovedC++ PythonO(nlogn)O(n)Hard🔒, variant of Longest Increasing SubsequenceBinary Search
3233Find the Count of Numbers Which Are Not SpecialC++ Pythonprecompute: O(sqrt(r))
runtime: O(logr)
O(sqrt(r))MediumNumber Theory, Linear Sieve of Eratosthenes, Binary Search
3281Maximize Score of Numbers in RangesC++ PythonO(nlogr)O(1)MediumBinary Search, Greedy


Binary Search Tree

#TitleSolutionTimeSpaceDifficultyTagNote
2426Number of Pairs Satisfying InequalityC++ PythonO(nlogn)O(n)HardMerge Sort, Two Pointers, BIT, Fenwick Tree, Coordinate Compression, Sorted List, Ordered Set, Binary Search
2689Extract Kth Character From The Rope TreeC++ PythonO(h)O(1)Medium🔒BST
2817Minimum Absolute Difference Between Elements With ConstraintC++ PythonO(nlogn)O(n)MediumSorted List, BST, Binary Search
2907Maximum Profitable Triplets With Increasing Prices IC++ PythonO(nlogn)O(n)Medium🔒Prefix Sum, Sorted List, BST, Binary Search, Mono Stack, BIT, Fenwick Tree, Segment Tree
2921Maximum Profitable Triplets With Increasing Prices IIC++ PythonO(nlogn)O(n)Hard🔒Prefix Sum, Sorted List, BST, Binary Search, Mono Stack, BIT, Fenwick Tree, Segment Tree
2926Maximum Balanced Subsequence SumC++ PythonO(nlogn)O(n)HardSorted List, BST, Binary Search, Mono Stack, BIT, Fenwick Tree, Segment Tree
3072Distribute Elements Into Two Arrays IIC++ PythonO(nlogn)O(n)HardSorted List, Ordered Set
3073Maximum Increasing Triplet ValueC++ PythonO(nlogn)O(n)Medium🔒Sorted List, BST, Prefix Sum
3161Block Placement QueriesC++ PythonO(qlogq)O(q)HardSorted List, BST, BIT, Fenwick Tree, Segment Tree
3165Maximum Sum of Subsequence With Non-adjacent ElementsC++ PythonO(n + qlogn)O(n)HardSegment Tree


Breadth-First Search

#TitleSolutionTimeSpaceDifficultyTagNote
2039The Time When the Network Becomes IdleC++ PythonO(|E|)O(|E|)MediumMath
2045Second Minimum Time to Reach DestinationC++ PythonO(|E|)O(|E|)HardBi-BFS
2050Parallel Courses IIIC++ PythonO(|V| + |E|)O(|E|)Hardvariant of Parallel CoursesTopological Sort
2059Minimum Operations to Convert NumberC++ PythonO(m * n)O(m)Medium
2115Find All Possible Recipes from Given SuppliesC++ PythonO(|E|)O(|E|)MediumTopological Sort
2146K Highest Ranked Items Within a Price RangeC++ PythonO(m * n + klogk)O(m * n)MediumBFS, Quick Select, Sort
2258Escape the Spreading FireC++ PythonO(m * n)O(m * n)HardBFS
2290Minimum Obstacle Removal to Reach CornerC++ PythonO(m * n)O(m * n)Hardvariant of Minimum Cost to Make at Least One Valid Path in a GridA* Search Algorithm, 0-1 BFS, Deque
2316Count Unreachable Pairs of Nodes in an Undirected GraphC++ PythonO(n)O(n)MediumFlood Fill, BFS, Math
2368Reachable Nodes With RestrictionsC++ PythonO(n)O(n)MediumBFS
2415Reverse Odd Levels of Binary TreeC++ PythonO(n)O(n)MediumBFS
2471Minimum Number of Operations to Sort a Binary Tree by LevelC++ PythonO(nlogn)O(w)MediumSort, BFS
2492Minimum Score of a Path Between Two CitiesC++ PythonO(n + m)O(n + m)MediumBFS
2493Divide Nodes Into the Maximum Number of GroupsC++ PythonO(n^2)O(n)Mediumvariant of Is Graph Bipartite?BFS, DFS
2503Maximum Number of Points From Grid QueriesC++ PythonO((m * n + q) * log(m * n))O(m * n)HardBFS, Heap, Prefix Sum, Binary Search
2577Minimum Time to Visit a Cell In a GridC++ PythonO(m * n * log(m * n))O(m * n)HardDijkstra's Algorithm
2583Kth Largest Sum in a Binary TreeC++ PythonO(n)O(n)MediumBFS, Quick Select
2603Collect Coins in a TreeC++ PythonO(n)O(n)HardTree, BFS
2612Minimum Reverse OperationsC++ PythonO(n)O(n)HardBFS, Union Find, BST, Sorted List
2617Minimum Number of Visited Cells in a GridC++ PythonO(m * n)O(m * n)Hardvariant of Minimum Reverse OperationsBFS, Union Find, BST, Sorted List
2641Cousins in Binary Tree IIC++ PythonO(n)O(w)MediumBFS
2658Maximum Number of Fish in a GridC++ PythonO(m * n)O(m + n)MediumBFS, DFS
2685Count the Number of Complete ComponentsC++ PythonO(n)O(n)MediumBFS
2709Greatest Common Divisor TraversalC++ Pythonprecompute: O(sqrt(r))
runtime: O(n * (logr + sqrt(r)/log(sqrt(r))))
O(sqrt(r) + nlogr)HardLinear Sieve of Eratosthenes, Factorization, BFS
2812Find the Safest Path in a GridC++ PythonO(n^2)O(n^2)MediumBFS, Bucket Sort, Union Find, Dijkstra's Algorithm, Binary Search
2814Minimum Time Takes to Reach Destination Without DrowningC++ PythonO(m * n)O(m * n)Hard🔒Simulation, BFS
2852Sum of Remoteness of All CellsC++ PythonO(n^2)O(n^2)Medium🔒Flood Fill, BFS, Math
3157Find the Level of Tree with Minimum SumC++ PythonO(n)O(w)Medium🔒BFS


Depth-First Search

#TitleSolutionTimeSpaceDifficultyTagNote
2049Count Nodes With the Highest ScoreC++ PythonO(n)O(n)Medium
2065Maximum Path Quality of a GraphC++ PythonO(|V| + |E| + 4^10)O(|V| + |E| )HardPruning
2192All Ancestors of a Node in a Directed Acyclic GraphC++ PythonO(|V| * |E|)O(|V| + |E|)MediumDFS, BFS, Topological Sort
2246Longest Path With Different Adjacent CharactersC++ PythonO(n)O(h)HardDFS, BFS, Topological Sort
2265Count Nodes Equal to Average of SubtreeC++ PythonO(n)O(h)MediumDFS, Tree
2322Minimum Score After Removals on a TreeC++ PythonO(n^2)O(n)HardDFS, Tree
2331Evaluate Boolean Binary TreeC++ PythonO(n)O(h)EasyDFS
2385Amount of Time for Binary Tree to Be InfectedC++ PythonO(n)O(h)MediumBFS, DFS, Tree DP
2445Number of Nodes With Value OneC++ PythonO(q + h)O(q + h)Medium🔒Tree, DFS, BFS
2458Height of Binary Tree After Subtree Removal QueriesC++ PythonO(n)O(n)HardTree, DFS
2467Most Profitable Path in a TreeC++ PythonO(n)O(n)MediumTree, DFS
2477Minimum Fuel Cost to Report to the CapitalC++ PythonO(n)O(h)MediumTree, DFS
2581Count Number of Possible Root NodesC++ PythonO(n)O(h)HardTree, DFS
2773Height of Special Binary TreeC++ PythonO(n)O(h)Medium🔒Tree, DFS, BFS
2791Count Paths That Can Form a Palindrome in a TreeC++ PythonO(n)O(n)HardTree, DFS, Freq Table
2973Find Number of Coins to Place in Tree NodesC++ PythonO(n)O(n)HardDFS
3004Maximum Subtree of the Same ColorC++ PythonO(n)O(h)Medium🔒DFS
3067Count Pairs of Connectable Servers in a Weighted Tree NetworkC++ PythonO(n^2)O(n)MediumDFS, BFS
3203Find Minimum Diameter After Merging Two TreesC++ PythonO(n + m)O(n + m)Hardvariant of Tree DiameterDFS, BFS, Tree DP, Tree Diameter
3249Count the Number of Good NodesC++ PythonO(n)O(h)MediumDFS


Backtracking

#TitleSolutionTimeSpaceDifficultyTagNote
2014Longest Subsequence Repeated k TimesC++ PythonO(n * (n/k)!)O(n/k)Hard
2056Number of Valid Move Combinations On ChessboardC++ PythonO(1)O(1)Hard
2094Finding 3-Digit Even NumbersC++ PythonO(n)O(1)Easy
2443Sum of Number and Its ReverseC++ PythonO(n^(1/(2*log2(10))))O(log10(n)/2)MediumBrute Force, Backtracking
2664The Knight’s TourC++ PythonO(m * n)O(1)Medium🔒Backtracking, Greedy, Warnsdorff's Rule
2698Find the Punishment Number of an IntegerC++ PythonO(n * (logn)^(2*logn))O(logn)MediumBacktracking
2741Special PermutationsC++ PythonO(n^2 * 2^n)O(n * 2^n)MediumBacktracking, Memoization
3211Generate Binary Strings Without Adjacent ZerosC++ PythonO(n * 2^n)O(n)MediumBacktracking, BFS


Dynamic Programming

#TitleSolutionTimeSpaceDifficultyTagNote
2002Maximum Product of the Length of Two Palindromic SubsequencesC++ PythonO(3^n)O(2^n)MediumDP, Submask Enumeration
2008Maximum Earnings From TaxiC++ PythonO(n + mlogm)O(n)MediumDP
2019The Score of Students Solving Math ExpressionC++ PythonO(n^3 * a^2)O(n^2)Hardvariant of Burst Balloons
2031Count Subarrays With More Ones Than ZerosC++ PythonO(n)O(n)Medium🔒Prefix Sum, DP
2044Count Number of Maximum Bitwise-OR SubsetsC++ PythonO(min(2^n, m * n))O(min(2^n, m))MediumDP
2052Minimum Cost to Separate Sentence Into RowsC++ PythonO(s + n * k)O(k)Medium🔒DP
2060Check if an Original String Exists Given Two Encoded StringsC++ PythonO(m * n * k)O(min(m, n) * k)HardDP, Memoization
2088Count Fertile Pyramids in a LandC++ PythonO(m * n)O(n)HardDP
2140Solving Questions With BrainpowerC++ PythonO(n)O(n)MediumDP
2143Choose Numbers From Two Arrays in RangeC++ PythonO(n^2 * v)O(n * v)Hard🔒DP
2167Minimum Time to Remove All Cars Containing Illegal GoodsC++ PythonO(n)O(1)HardDP
2174Remove All Ones With Row and Column Flips IIC++ PythonO((m * n) * 2^(m * n))O(2^(m * n))Medium🔒DP, Bitmasks
2184Number of Ways to Build Sturdy Brick WallC++ PythonO(h * p^2)O(p^2)Medium🔒, variant of Painting a Grid With Three Different ColorsDP, Backtracking, Matrix Exponentiation
2188Minimum Time to Finish the RaceC++ PythonO((n + l) * logc)O(n + l + logc)HardGreedy, DP
2189Number of Ways to Build House of CardsC++ PythonO(n^2)O(n)Medium🔒DP
2209Minimum White Tiles After Covering With CarpetsC++ PythonO(m * n)O(m * n)HardDP
2218Maximum Value of K Coins From PilesC++ PythonO(min(n * k^2, m * k)))O(k)HardDP
2222Number of Ways to Select BuildingsC++ PythonO(n)O(1)MediumDP
2247Maximum Cost of Trip With K HighwaysC++ PythonO(n^2 * 2^n)O(n * 2^n)Hard🔒DP, Bitmasks, BFS
2266Count Number of TextsC++ PythonO(n)O(1)MediumDP
2267Check if There Is a Valid Parentheses String PathC++ PythonO(m * n * (m + n) / 32)O(n * (m + n) / 32)Hardvariant of Codeforces Round #801 CDP, Bitsets
2289Steps to Make Array Non-decreasingC++ PythonO(n)O(n)HardDP, Mono Stack
2291Maximum Profit From Trading StocksC++ PythonO(n * b)O(b)Medium🔒DP
2297Jump Game IXC++ PythonO(n)O(1)Medium🔒DP, Mono Stack
2304Minimum Path Cost in a GridC++ PythonO(m * n^2)O(n)MediumDP
2305Fair Distribution of CookiesC++ PythonO(k * 3^n)O(2^n)MediumDP, Submask Enumeration
2312Selling Pieces of WoodC++ PythonO(m * n * (m + n))O(m + n)HardDP
2313Minimum Flips in Binary Tree to Get ResultC++ PythonO(n)O(h)Hard🔒Tree DP
2318Number of Distinct Roll SequencesC++ PythonO(6^3 * n)O(6^2)HardDP
2320Count Number of Ways to Place HousesC++ PythonO(logn)O(1)Mediumvariant of Fibonacci NumberMatrix Exponentiation
2327Number of People Aware of a SecretC++ PythonO(n)O(f)MediumDP
2328Number of Increasing Paths in a GridC++ PythonO(m * n)O(m * n)HardMemoization, Topological Sort, DP
2361Minimum Costs Using the Train LineC++ PythonO(n)O(1)Hard🔒DP
2369Check if There is a Valid Partition For The ArrayC++ PythonO(n)O(1)MediumDP
2370Longest Ideal SubsequenceC++ PythonO(n)O(1)MediumDP
2378Choose Edges to Maximize Score in a TreeC++ PythonO(n)O(n)Medium🔒DFS, Stack, Tree DP
2380Time Needed to Rearrange a Binary StringC++ PythonO(n)O(1)MediumDP
2403Minimum Time to Kill All MonstersC++ PythonO(n * 2^n)O(2^n)Hard🔒Bitmasks, DP
2420Find All Good IndicesC++ PythonO(n)O(n)MediumPrefix Sum
2430Maximum Deletions on a StringC++ PythonO(n^2)O(n)HardDP, Rabin-Karp Algorithm, Rolling Hash, Longest Prefix Suffix, KMP Algorithm
2431Maximize Total Tastiness of Purchased FruitsC++ PythonO(n * a * c)O(a * c)Medium🔒DP
2435Paths in Matrix Whose Sum Is Divisible by KC++ PythonO(m * n * k)O(n * k)HardDP
2447Number of Subarrays With GCD Equal to KC++ PythonO(nlogr)O(logr)MediumDP
2463Minimum Total Distance TraveledC++ PythonO(mlogm + nlogn + m * n)O(n)HardSort, DP, Prefix Sum, Mono Deque
2464Minimum Subarrays in a Valid SplitC++ PythonO(n^2 * logr)O(n)Medium🔒DP
2466Count Ways To Build Good StringsC++ PythonO(n)O(n)MediumDP
2470Number of Subarrays With LCM Equal to KC++ PythonO(n * sqrt(k) * logk)O(sqrt(k))Mediumvariant of Number of Subarrays With GCD Equal to KDP
2470Number of Subarrays With LCM Equal to KC++ PythonO(n * sqrt(k) * logk)O(sqrt(k))Mediumvariant of Number of Subarrays With GCD Equal to KDP
2475Number of Unequal Triplets in ArrayC++ PythonO(n)O(n)EasyDP, Freq Table, Math
2478Number of Beautiful PartitionsC++ PythonO(n * k)O(n)HardDP
2495Number of Subarrays Having Even ProductC++ PythonO(n)O(1)Medium🔒DP, Math
2510Check if There is a Path With Equal Number of 0's And 1'sC++ PythonO(m * n)O(n)Medium🔒DP
2518Number of Great PartitionsC++ PythonO(n * k)O(k)HardKnapsack DP
2533Number of Good Binary StringsC++ PythonO(n)O(w)Medium🔒DP
2538Difference Between Maximum and Minimum Price SumC++ PythonO(n)O(n)HardDFS, Tree DP
2547Minimum Cost to Split an ArrayC++ PythonO(n^2)O(n)HardDP
2552Count Increasing QuadrupletsC++ PythonO(n^2)O(n)Hardvariant of 132 PatternDP, Prefix Sum
2556Disconnect Path in a Binary Matrix by at Most One FlipC++ PythonO(m * n)O(m + n)MediumDP, DFS
2565Subsequence With the Minimum ScoreC++ PythonO(n)O(n)HardTwo Pointers, DP
2572Count the Number of Square-Free SubsetsC++ PythonO(n + m * 2^p)O(m * 2^p)MediumNumber Theory, Combinatorics, Bitmasks, Memoization, DP
2585Number of Ways to Earn PointsC++ PythonO(n * t * c)O(t)HardKnapsack DP
2597The Number of Beautiful SubsetsC++ PythonO(n)O(n)MediumCombinatorics, DP
2638Count the Number of K-Free SubsetsC++ PythonO(n)O(n)Medium🔒, variant of The Number of Beautiful SubsetsCombinatorics, DP
2646Minimize the Total Price of the TripsC++ PythonO(t * n)O(n)HardDFS, Tree DP
2681Power of HeroesC++ PythonO(nlogn)O(1)HardSort, Combinatorics, DP
2684Maximum Number of Moves in a GridC++ PythonO(m * n)O(m)MediumDP, BFS
2707Extra Characters in a StringC++ PythonO(n * l)O(n + t)MediumDP, Trie
2713Maximum Strictly Increasing Cells in a MatrixC++ PythonO(m * n * log(m * n))O(m * n)HardSort, DP
2719Count of IntegersC++ PythonO(m * n)O(m + n)HardCombinatorics, DP
2742Painting the WallsC++ PythonO(n^2)O(n)HardKnapsack DP
2746Decremental String ConcatenationC++ PythonO(n)O(1)MediumDP
2767Partition String Into Minimum Beautiful SubstringsC++ PythonO(n^2)O(n)MediumDP
2770Maximum Number of Jumps to Reach the Last IndexC++ PythonO(n^2)O(n)MediumDP
2771Longest Non-decreasing Subarray From Two ArraysC++ PythonO(n)O(1)MediumDP
2786Visit Array Positions to Maximize ScoreC++ PythonO(n)O(1)MediumDP
2787Ways to Express an Integer as Sum of PowersC++ PythonO(nlogn)O(n)MediumKnapsack DP
2801Count Stepping Numbers in RangeC++ PythonO(n)O(1)HardDP
2809Minimum Time to Make Array Sum At Most xC++ PythonO(n^2)O(n)HardSort, Greedy, DP, Linear Search
2826Sorting Three GroupsC++ PythonO(n)O(1)MediumDP
2827Number of Beautiful Integers in the RangeC++ PythonO(n^2 * k)O(n * k)HardDP, Memoization
2830Maximize the Profit as the SalesmanC++ PythonO(n + m)O(n + m)MediumDP
2858Minimum Edge Reversals So Every Node Is ReachableC++ PythonO(n)O(n)HardDFS, Tree DP
2867Count Valid Paths in a TreeC++ PythonO(n)O(n)HardNumber Theory, Linear Sieve of Eratosthenes, DFS, Tree DP, Union Find
2896Apply Operations to Make Two Strings EqualC++ PythonO(n)O(1)MediumDP
2901Longest Unequal Adjacent Groups Subsequence IIC++ PythonO(n^2)O(n)MediumDP, Backtracing, LIS DP
2902Count of Sub-Multisets With Bounded SumC++ PythonO(n + d * r)O(d + r)HardFreq Table, DP, Sliding Window, Combinatorics
2911Minimum Changes to Make K Semi-palindromesC++ PythonO(n^3)O(n^2 * logn)HardNumber Theory, DP
2912Number of Ways to Reach Destination in the GridC++ PythonO(logn)O(1)Hard🔒DP, Matrix Exponentiation
2913Subarrays Distinct Element Sum of Squares IC++ PythonO(nlogn)O(n)EasyDP, Segment Tree, BIT, Fenwick Tree, Ordered Set, Sorted List, Math, Hash Table
2915Length of the Longest Subsequence That Sums to TargetC++ PythonO(n * t)O(t)MediumKnapsack DP
2916Subarrays Distinct Element Sum of Squares IIC++ PythonO(nlogn)O(n)EasyDP, Segment Tree, BIT, Fenwick Tree, Ordered Set, Sorted List, Math
2919Minimum Increment Operations to Make Array BeautifulC++ PythonO(n)O(1)MediumDP
2920Maximum Points After Collecting Coins From All NodesC++ PythonO(nlogr)O(n)HardTree DP, Memoization, DFS, Pruning
2925Maximum Score After Applying Operations on a TreeC++ PythonO(n)O(n)MediumDFS, Tree DP
2941Maximum GCD-Sum of a SubarrayC++ PythonO(nlogr)O(logr)Hard🔒Number Theory, DP, Prefix Sum, Binary Search, RMQ, Sparse Table
2944Minimum Number of Coins for FruitsC++ PythonO(n)O(n)MediumDP, Sorted List, BST, Mono Deque
2945Find Maximum Non-decreasing Array LengthC++ PythonO(n)O(n)HardDP, Greedy, Prefix Sum, Binary Search, Mono Stack, Mono Deque, Two Pointers
2969Minimum Number of Coins for Fruits IIC++ PythonO(n)O(n)Hard🔒DP, Sorted List, BST, Mono Deque
2976Minimum Cost to Convert String IC++ PythonO(o + k * eloge + n)O(o + k * v)MediumDijkstra's Algorithm, Floyd-Warshall Algorithm, DP, Memoization
2977Minimum Cost to Convert String IIC++ PythonO(o * l + k * eloge + n * l)O(t + k * v + l)HardDijkstra's Algorithm, Floyd-Warshall Algorithm, DP, Memoization, Trie
2992Number of Self-Divisible PermutationsC++ PythonO(n * 2^n)O(2^n)Medium🔒Bitmasks, DP
2998Minimum Number of Operations to Make X and Y EqualC++ PythonO(x)O(x)MediumMemoization, BFS
3018Maximum Number of Removal Queries That Can Be Processed IC++ PythonO(n^2)O(n^2)Hard🔒DP
3020Find the Maximum Number of Elements in SubsetC++ PythonO(n)O(n)MediumFreq Table, DP
3040Maximum Number of Operations With the Same Score IIC++ PythonO(n^2)O(n^2)MediumMemoization
3041Maximize Consecutive Elements in an Array After ModificationC++ PythonO(nlogn)O(1)HardSort, DP
3077Maximum Strength of K Disjoint SubarraysC++ PythonO(k * n)O(n)HardDP, Greedy, Kadane's Algorithm
3082Find the Sum of the Power of All SubsequencesC++ PythonO(n * k)O(k)HardDP, Combinatorics
3098Find the Sum of Subsequence PowersC++ PythonO(n^3 * k)O(n^2)HardDP, Prefix Sum, Two Pointers
3101Count Alternating SubarraysC++ PythonO(n)O(1)MediumDP
3117Minimum Sum of Values by Dividing ArrayC++ PythonO(n * m * logr)O(n + logr)HardMemoization, DP, RMQ, Sparse Table, Mono Deque, Two Pointers
3122Minimum Number of Operations to Satisfy ConditionsC++ PythonO(n * (m + 10))O(10)MediumDP
3129Find All Possible Stable Binary Arrays IC++ PythonO(n * m)O(n * m)MediumDP
3130Find All Possible Stable Binary Arrays IIC++ PythonO(n * m)O(n * m)HardDP
3141Maximum Hamming DistancesC++ PythonO(m * 2^m)O(2^m)Hard🔒Bitmasks, BFS, Knapsack DP
3144Minimum Substring Partition of Equal Character FrequencyC++ PythonO(n * (n + 26))O(n + 26)MediumDP, Freq Table
3148Maximum Difference Score in a GridC++ PythonO(m * n)O(1)MediumDP
3149Find the Minimum Cost Array PermutationC++ PythonO((n-1)^2 * 2^(n-1))O((n-1) * 2^(n-1))HardDP, Backtracing
3176Find the Maximum Length of a Good Subsequence IC++ PythonO(n * k)O(n * k)MediumDP
3177Find the Maximum Length of a Good Subsequence IIC++ PythonO(n * k)O(n * k)HardDP
3180Maximum Total Reward Using Operations IC++ PythonO(n * k)O(n * k)MediumSort, DP, Bitset
3181Maximum Total Reward Using Operations IIC++ PythonO(n * k)O(n * k)HardSort, DP, Bitset
3186Maximum Total Damage With Spell CastingC++ PythonO(nlogn)O(n)MediumSort, DP, Two Pointers, Sliding window, Deque
3193Count the Number of InversionsC++ PythonO(n * k)O(n + k)Hardvariant of K Inverse Pairs ArrayKnapsack DP, Combinatorics, Sliding Window, Two Pointers
3196Maximize Total Cost of Alternating SubarraysC++ PythonO(n)O(1)MediumDP
3197Find the Minimum Area to Cover All Ones IIC++ PythonO(max(n, m)^2)O(max(n, m)^2)HardArray, Brute Force, Prefix Sum, Binary Search, RMQ, Sparse Table, DP
3201Find the Maximum Length of Valid Subsequence IC++ PythonO(n)O(1)MediumBrute Force, DP
3202Find the Maximum Length of Valid Subsequence IIC++ PythonO(n * k)O(k)MediumDP
3209Number of Subarrays With AND Value of KC++ PythonO(nlogr)O(logr)Hardvariant of Find Subarray With Bitwise OR Closest to KDP
3212Count Submatrices With Equal Frequency of X and YC++ PythonO(n * m)O(n * m)MediumDP
3213Construct String with Minimum CostC++ PythonO(n^2 + w * l)O(t)HardDP, Trie
3225Maximum Score From Grid OperationsC++ PythonO(n^3)O(n)HardPrefix Sum, DP
3241Time Taken to Mark All NodesC++ PythonO(n)O(n)HardTree DP, BFS, DFS
3253Construct String with Minimum Cost (Easy)C++ PythonO(n * w * l)O(l)Medium🔒DP, Trie
3259Maximum Energy Boost From Two DrinksC++ PythonO(n)O(1)MediumDP
3269Constructing Two Increasing ArraysC++ PythonO(m * n)O(min(m, n))Hard🔒DP
3277Maximum XOR Score Subarray QueriesC++ PythonO(n^2 + q)O(n^2)HardDP
3283Maximum Number of Moves to Kill All PawnsC++ PythonO(p^2 * 2^p)O(p * 2^p)HardBFS, Bitmasks, DP


Greedy

#TitleSolutionTimeSpaceDifficultyTagNote
2027Minimum Moves to Convert StringC++ PythonO(n)O(1)Easy
2030Smallest K-Length Subsequence With Occurrences of a LetterC++ PythonO(n)O(n)HardMono Stack, Greedy
2036Maximum Alternating Subarray SumC++ PythonO(n)O(1)Mediumvariant of Maximum Alternating Subsequence Sum, 🔒Greedy, Kadane's Algorithm
2037Minimum Number of Moves to Seat EveryoneC++ PythonO(nlogn)O(1)EasyGreedy
2071Maximum Number of Tasks You Can AssignC++ PythonO(n * (logn)^2)O(n)HardGreedy, Binary Search, Sorted List
2086Minimum Number of Buckets Required to Collect Rainwater from HousesC++ PythonO(n)O(1)MediumGreedy
2087Minimum Cost Homecoming of a Robot in a GridC++ PythonO(m + n)O(1)MediumGreedy
2126Destroying AsteroidsC++ PythonO(nlogn)O(1)MediumGreedy
2136Earliest Possible Day of Full BloomC++ PythonO(nlogn)O(n)HardGreedy
2139Minimum Moves to Reach Target ScoreC++ PythonO(logn)O(1)Medium
2141Maximum Running Time of N ComputersC++ PythonO(nlogm)O(1)HardGreedy, Binary Search
2144Minimum Cost of Buying Candies With DiscountC++ PythonO(nlogn)O(1)EasyGreedy, Sort
2147Number of Ways to Divide a Long CorridorC++ PythonO(n)O(1)HardGreedy, Combinatorics
2160Minimum Sum of Four Digit Number After Splitting DigitsC++ PythonO(1)O(1)EasyGreedy
2165Smallest Value of the Rearranged NumberC++ PythonO(d)O(d)MediumGreedy, Counting Sort
2178Maximum Split of Positive Even IntegersC++ PythonO(sqrt(n))O(1)MediumGreedy
2182Construct String With Repeat LimitC++ PythonO(n)O(1)MediumGreedy
2193Minimum Number of Moves to Make PalindromeC++ PythonO(nlogn)O(n)HardGreedy, BIT, Fenwick Tree
2195Append K Integers With Minimal SumC++ PythonO(nlogn)O(n)MediumGreedy
2207Maximize Number of Subsequences in a StringC++ PythonO(n)O(1)MediumCounting, Greedy
2214Minimum Health to Beat GameC++ PythonO(n)O(1)Medium🔒Greedy
2216Minimum Deletions to Make Array BeautifulC++ PythonO(n)O(1)MediumGreedy
2224Minimum Number of Operations to Convert TimeC++ PythonO(1)O(1)EasyGreedy
2259Remove Digit From Number to Maximize ResultC++ PythonO(n)O(1)EasyGreedy
2263Make Array Non-decreasing or Non-increasingC++ PythonO(nlogn)O(n)Hard🔒DP, Greedy, Heap
2268Minimum Number of KeypressesC++ PythonO(n)O(1)Medium🔒Greedy, Sort
2279Maximum Bags With Full Capacity of RocksC++ PythonO(nlogn)O(1)MediumGreedy, Sort
2285Maximum Total Importance of RoadsC++ PythonO(n)O(n)MediumGreedy, Counting Sort
2294Partition Array Such That Maximum Difference Is KC++ PythonO(nlogn)O(1)MediumGreedy
2311Longest Binary Subsequence Less Than or Equal to KC++ PythonO(n)O(1)MediumGreedy
2321Maximum Score Of Spliced ArrayC++ PythonO(n)O(1)HardGreedy, Kadane's Algorithm
2323Find Minimum Time to Finish All Jobs IIC++ PythonO(nlogn)O(1)Medium🔒Greedy
2340Minimum Adjacent Swaps to Make a Valid ArrayC++ PythonO(n)O(1)Medium🔒Array, Greedy
2366Minimum Replacements to Sort the ArrayC++ PythonO(n)O(1)HardGreedy, Math
2371Minimize Maximum Value in a GridC++ PythonO((m * n) * log(m * n))O(m * n)Hard🔒Sort, Greedy
2375Construct Smallest Number From DI StringC++ PythonO(n)O(1)MediumConstructive Algorithms, Greedy
2383Minimum Hours of Training to Win a CompetitionC++ PythonO(n)O(1)EasyGreedy
2384Largest Palindromic NumberC++ PythonO(n)O(1)MediumFreq Table, Greedy
2405Optimal Partition of StringC++ PythonO(n)O(n)MediumGreedy, Hash Table
2410Maximum Matching of Players With TrainersC++ PythonO(nlogn + mlogm)O(1)MediumGreedy, Sort
2412Minimum Money Required Before TransactionsC++ PythonO(n)O(1)HardGreedy, Constructive Algorithms
2417Closest Fair IntegerC++ PythonO(logn)O(logn)Medium🔒Constructive Algorithms, Greedy
2422Merge Operations to Turn Array Into a PalindromeC++ PythonO(n)O(1)Medium🔒Constructive Algorithms, Greedy, Two Pointers
2434Using a Robot to Print the Lexicographically Smallest StringC++ PythonO(n)O(n)MediumFreq Table, Greedy
2436Minimum Split Into Subarrays With GCD Greater Than OneC++ PythonO(nlogr)O(1)Medium🔒Greedy
2439Minimize Maximum of ArrayC++ PythonO(n)O(1)MediumGreedy
2440Create Components With Same ValueC++ PythonO(n * sqrt(n))O(n)HardBFS, DFS, Greedy
2449Minimum Number of Operations to Make Arrays SimilarC++ PythonO(nlogn)O(1)HardGreedy, Sort
2457Minimum Addition to Make Integer BeautifulC++ PythonO(logn)O(1)MediumGreedy
2459Sort Array by Moving Items to Empty SpaceC++ PythonO(n)O(n)Hard🔒Greedy, Sort
2472Maximum Number of Non-overlapping Palindrome SubstringsC++ PythonO(n * k)O(1)HardTwo Pointers, Greedy
2479Maximum XOR of Two Non-Overlapping SubtreesC++ PythonO(nlogr)O(n)Hard🔒, variant of Maximum XOR of Two Numbers in an ArrayDFS, Trie, Greedy
2483Minimum Penalty for a ShopC++ PythonO(n)O(1)MediumGreedy
2486Append Characters to String to Make SubsequenceC++ PythonO(n)O(1)MediumTwo Pointers, Greedy
2498Frog Jump IIC++ PythonO(n)O(1)MediumGreedy
2499Minimum Total Cost to Make Arrays UnequalC++ PythonO(n)O(n)HardGreedy
2522Partition String Into Substrings With Values at Most KC++ PythonO(n)O(1)MediumGreedy
2541Minimum Operations to Make Array Equal IIC++ PythonO(n)O(1)MediumGreedy
2542Maximum Subsequence ScoreC++ PythonO(nlogn)O(n)Mediumvariant of Maximum Performance of a TeamGreedy, Heap
2548Maximum Price to Fill a BagC++ PythonO(nlogn)O(1)Medium🔒Greedy, Sort
2551Put Marbles in BagsC++ PythonO(n) on averageO(1)HardGreedy, Quick Select
2561Rearranging FruitsC++ PythonO(n) on averageO(n)HardFreq Table, Greedy, Quick Select
2566Maximum Difference by Remapping a DigitC++ PythonO(logn)O(1)EasyGreedy
2567Minimum Score by Changing Two ElementsC++ PythonO(nlogn)O(1)MediumSort, Greedy
2571Minimum Operations to Reduce an Integer to 0C++ PythonO(logn)O(1)MediumGreedy, Trick
2573Find the String with LCPC++ PythonO(n^2)O(1)HardConstructive Algorithms, Greedy, DP
2576Find the Maximum Number of Marked IndicesC++ PythonO(nlogn)O(1)MediumSort, Greedy, Two Pointers
2578Split With Minimum SumC++ PythonO(mlogm)O(m)EasySort, Greedy
2587Rearrange Array to Maximize Prefix ScoreC++ PythonO(nlogn)O(1)MediumSort, Greedy
2589Minimum Time to Complete All TasksC++ PythonO(nlogn + n * r)O(r)HardSort, Greedy
2591Distribute Money to Maximum ChildrenC++ PythonO(1)O(1)EasyGreedy, Math
2599Make the Prefix Sum Non-negativeC++ PythonO(nlogn)O(n)Medium🔒Prefix Sum, Greedy, Heap
2600K Items With the Maximum SumC++ PythonO(1)O(1)EasyGreedy, Math
2601Prime Subtraction OperationC++ PythonO(p + nlogp)O(p)MediumNumber Theory, Greedy, Binary Search
2604Minimum Time to Eat All GrainsC++ PythonO(mlogm + nlogn + (m + n) * logr)O(1)Hard🔒Binary Search, Greedy
2606Find the Substring With Maximum CostC++ PythonO(n)O(1)MediumGreedy, Kadane's Algorithm
2607Make K-Subarray Sums EqualC++ PythonO(n)O(n)MediumMath, Greedy, Quick Select
2611Mice and CheeseC++ PythonO(n)O(1)MediumGreedy, Quick Select
2645Minimum Additions to Make Valid StringC++ PythonO(n)O(1)MediumGreedy
2663Lexicographically Smallest Beautiful StringC++ PythonO(n)O(1)HardGreedy
2673Make Costs of Paths Equal in a Binary TreeC++ PythonO(n)O(1)MediumTree, Greedy
2680Maximum ORC++ PythonO(n)O(n)MediumPrefix Sum, Greedy
2697Lexicographically Smallest PalindromeC++ PythonO(n)O(1)EasyGreedy
2706Buy Two ChocolatesC++ PythonO(n)O(1)EasyGreedy
2708Maximum Strength of a GroupC++ PythonO(n)O(1)MediumGreedy
2712Minimum Cost to Make All Characters EqualC++ PythonO(n)O(1)MediumGreedy
2734Lexicographically Smallest String After Substring OperationC++ PythonO(n)O(1)MediumGreedy
2769Find the Maximum Achievable NumberC++ PythonO(1)O(1)EasyGreedy, Math
2772Apply Operations to Make All Array Elements Equal to ZeroC++ PythonO(n)O(1)MediumGreedy, Sliding Window
2789Largest Element in an Array after Merge OperationsC++ PythonO(n)O(1)MediumGreedy
2790Maximum Number of Groups With Increasing LengthC++ PythonO(n)O(n)HardConstructive Algorithms, Counting Sort, Greedy, Binary Search, Prefix Sum
2813Maximum Elegance of a K-Length SubsequenceC++ PythonO(nlogk)O(k)HardPartial Sort, Heap, Quick Select, BST, Sorted List, Greedy
2819Minimum Relative Loss After Buying ChocolatesC++ PythonO((n + q) * logn)O(n)Hard🔒Sort, Binary Search, Greedy, Prefix Sum
2825Make String a Subsequence Using Cyclic IncrementsC++ PythonO(n)O(1)MediumGreedy, Two Pointers
2835Minimum Operations to Form Subsequence With Target SumC++ PythonO(n)O(logn)HardEducational Codeforces Round #82 DCounting Sort, Sort, Heap, Greedy, Bitmasks
2842Count K-Subsequences of a String With Maximum BeautyC++ PythonO(n)O(1)HardGreedy, Quick Select, Combinatorics
2844Minimum Operations to Make a Special NumberC++ PythonO(n)O(1)MediumMath, Greedy
2847Smallest Number With Given Digit ProductC++ PythonO(logn)O(logn)Medium🔒Greedy
2860Happy StudentsC++ PythonO(n)O(n)MediumCodeforces Round #844 BSort, Greedy, Freq Table
2864Maximum Odd Binary NumberC++ PythonO(n)O(1)EasyGreedy, Partition
2868The Wording GameC++ PythonO(m + n)O(1)Hard🔒Game, Greedy
2870Minimum Number of Operations to Make Array EmptyC++ PythonO(n)O(n)MediumFreq Table, Greedy
2871Split Array Into Maximum Number of SubarraysC++ PythonO(n)O(1)MediumGreedy
2872Maximum Number of K-Divisible ComponentsC++ PythonO(n)O(n)Hardvariant of Create Components With Same ValueBFS, Greedy
2892Minimizing Array After Replacing Pairs With Their ProductC++ PythonO(n)O(1)Medium🔒Greedy
2895Minimum Processing TimeC++ PythonO(nlogn)O(1)MediumSort, Greedy
2897Apply Operations on Array to Maximize Sum of SquaresC++ PythonO(nlogr)O(logr)HardBit Manipulation, Greedy, Freq Table
2900Longest Unequal Adjacent Groups Subsequence IC++ PythonO(n)O(1)MediumGreedy
2910Minimum Number of Groups to Create a Valid AssignmentC++ PythonO(n)O(n)MediumLinear Search, Greedy, Math
2914Minimum Number of Changes to Make Binary String BeautifulC++ PythonO(n)O(1)MediumGreedy
2918Minimum Equal Sum of Two Arrays After Replacing ZerosC++ PythonO(n + m)O(1)MediumGreedy
2931Minimum Equal Sum of Two Arrays After Replacing ZerosC++ PythonO(m * n * logm)O(m)HardGreedy, Heap
2939Maximum Xor ProductC++ PythonO(n)O(1)MediumGreedy
2952Minimum Number of Coins to be AddedC++ PythonO(nlogn + logt)O(1)Mediumvariant of Patching ArraySort, Greedy
2957Remove Adjacent Almost-Equal CharactersC++ PythonO(n)O(1)MediumGreedy
2971Find Polygon With the Largest PerimeterC++ PythonO(n)O(1)MediumSort, Prefix Sum, Greedy
3002Maximum Size of a Set After RemovalsC++ PythonO(n)O(n)MediumMath, Hash Table, Greedy
3003Maximize the Number of Partitions After OperationsC++ PythonO(n)O(n)HardPrefix Sum, Greedy
3012Minimize Length of Array Using OperationsC++ PythonO(n)O(1)MediumGreedy
3014Minimum Number of Pushes to Type Word IC++ PythonO(4)O(1)EasyFreq Table, Greedy
3016Minimum Number of Pushes to Type Word IIC++ PythonO(n)O(26)MediumFreq Table, Greedy
3022Minimize OR of Remaining Elements Using OperationsC++ PythonO(nlogr)O(1)HardBitmasks, Greedy
3035Maximum Palindromes After OperationsC++ PythonO(n * l + nlogn)O(n)MediumFreq Table, Greedy, Sort
3068Find the Maximum Sum of Node ValuesC++ PythonO(n)O(1)HardGreedy
3074Apple Redistribution into BoxesC++ PythonO(nlogn)O(1)EasySort, Greedy
3075Maximize Happiness of Selected ChildrenC++ PythonO(nlogn)O(1)MediumSort, Greedy
3086Minimum Moves to Pick K OnesC++ PythonO(n)O(n)HardPrefix Sum, Greedy
3088Make String Anti-palindromeC++ PythonO(n + 26)O(26)Hard🔒Freq Table, Counting Sort, Greedy, Two Pointers
3106Lexicographically Smallest String After Operations With ConstraintC++ PythonO(n)O(1)MediumGreedy
3107Minimum Operations to Make Median of Array Equal to KC++ PythonO(n)O(1)MediumSort, Quick Select, Greedy
3111Minimum Rectangles to Cover PointsC++ PythonO(nlogn)O(n)MediumSort, Greedy
3114Latest Time You Can Obtain After Replacing CharactersC++ PythonO(1)O(1)EasyString, Greedy
3119Maximum Number of Potholes That Can Be FixedC++ PythonO(n)O(n)Medium🔒Sort, Counting Sort, Greedy
3170Lexicographically Minimum String After Removing StarsC++ PythonO(n + 26)O(n + 26)MediumGreedy, Hash Table, Stack
3189Minimum Moves to Get a Peaceful BoardC++ PythonO(n)O(n)Medium🔒, variant of Distribute Coins in Binary TreeCounting Sort, Prefix Sum, Greedy
3191Minimum Operations to Make Binary Array Elements Equal to One IC++ PythonO(n)O(1)MediumGreedy
3192Minimum Operations to Make Binary Array Elements Equal to One IIC++ PythonO(n)O(1)MediumGreedy
3205Maximum Array Hopping Score IC++ PythonO(n)O(1)Medium🔒DP, Prefix Sum, Greedy
3207Maximum Points After Enemy BattlesC++ PythonO(n)O(1)MediumGreedy
3216Lexicographically Smallest String After a SwapC++ PythonO(n)O(1)EasyGreedy
3218Minimum Cost for Cutting Cake IC++ PythonO(mlogm + nlogn)O(1)MediumMemoization, Greedy
3219Minimum Cost for Cutting Cake IIC++ PythonO(mlogm + nlogn)O(1)HardGreedy
3221Maximum Array Hopping Score IIC++ PythonO(n)O(1)Medium🔒Prefix Sum, Greedy
3228Maximum Number of Operations to Move Ones to the EndC++ PythonO(n)O(1)MediumGreedy
3229Minimum Operations to Make Array Equal to TargetC++ PythonO(n)O(1)Hardvariant of Minimum Number of Increments on Subarrays to Form a Target ArrayGreedy
3239Minimum Number of Flips to Make Binary Grid Palindromic IC++ PythonO(m * n)O(1)MediumArray, Greedy
3240Minimum Number of Flips to Make Binary Grid Palindromic IIC++ PythonO(m * n)O(1)MediumArray, Greedy
3273Minimum Amount of Damage Dealt to BobC++ PythonO(nlogn)O(n)HardSort, Greedy
3282Reach End of Array With Max ScoreC++ PythonO(n)O(1)MediumGreedy


Graph

#TitleSolutionTimeSpaceDifficultyTagNote
2076Process Restricted Friend RequestsC++ PythonO(n * r)O(n)HardUnion Find
2077Paths in Maze That Lead to Same RoomC++ PythonO(|V|^3)O(|E|)Medium🔒
2092Find All People With SecretC++ PythonO(nlogn)O(nlogn)HardBFS, DFS, Union Find
2093Minimum Path Cost in a Hidden GridC++ PythonO(|E| * log|V|)O(|V| + |E|)Mediumvariant of Cheapest Flights Within K Stops, 🔒Dijkstra's Algorithm, DP
2097Valid Arrangement of PairsC++ PythonO(|V| + |E|)O(|V| + |E|)Hardvariant of Reconstruct ItineraryHierholzer's Algorithm, Eulerian Path
2123Minimum Operations to Remove Adjacent Ones in MatrixC++ PythonO(m * n * sqrt(m * n))O(m + n)Hardvariant of Maximum Students Taking Exam, 🔒Hopcroft-Karp Bipartite Matching, Maximum Independent Set
2127Maximum Employees to Be Invited to a MeetingC++ PythonO(n)O(n)Hard
2172Maximum AND Sum of ArrayC++ PythonO(n^3)O(n^2)Hardvariant of Maximum Compatibility Score SumDP, Hungarian Weighted Bipartite Matching
2203Minimum Weighted Subgraph With the Required PathsC++ PythonO(|E| * log|V|)O(|E|)HardDijkstra's Algorithm
2204Distance to a Cycle in Undirected GraphC++ PythonO(|V| + |E|)O(|V| + |E|)Hard🔒Graph, DFS, BFS
2242Maximum Score of a Node SequenceC++ PythonO(|V| + |E|)O(|V|)HardGraph
2307Check for Contradictions in EquationsC++ PythonO(e + q)O(n)Hard🔒, variant of Evaluate DivisionDFS, Union Find
2359Find Closest Node to Given Two NodesC++ PythonO(n)O(n)MediumGraph, Hash Table, DFS
2360Longest Cycle in a GraphC++ PythonO(n)O(n)HardGraph, Hash Table, DFS
2392Build a Matrix With ConditionsC++ PythonO(k^2 + r + c)O(k + r + c)HardGraph, Topological Sort
2473Minimum Cost to Buy ApplesC++ PythonO(n * rlogn)O(n)Medium🔒Dijkstra's Algorithm
2508Add Edges to Make Degrees of All Nodes EvenC++ PythonO(n)O(n)HardGraph
2608Shortest Cycle in a GraphC++ PythonO(n^2)O(n + e)HardGraph, BFS
2662Minimum Cost of a Path With Special RoadsC++ PythonO(n^2)O(n^2)MediumGraph, Dijkstra's Algorithm
2699Modify Graph Edge WeightsC++ PythonO(|E| * log|V|)O(|E|)HardGraph, Dijkstra's Algorithm
2714Find Shortest Path with K HopsC++ PythonO(n * k + (k * e) * log(n * k))O(n * k + e)Hard🔒Graph, Dijkstra's Algorithm
2737Find the Closest Marked NodeC++ PythonO(|E| * log|V|)O(|E|)Medium🔒Graph, Dijkstra's Algorithm
2836Maximize Value of Function in a Ball Passing GameC++ PythonO(n)O(n)HardGraph, Prefix Sum, Two Pointers, Sliding Window, Binary Lifting
2850Minimum Moves to Spread Stones Over GridC++ PythonO(n^3)O(n^2)MediumBacktracking, Hungarian Weighted Bipartite Matching
2876Count Visited Nodes in a Directed GraphC++ PythonO(n)O(n)HardGraph, Hash Table, Stack
2924Find Champion IIC++ PythonO(n)O(n)MediumGraph, Hash Table
2959Number of Possible Sets of Closing BranchesC++ PythonO(r + 2^n * n^2)O(n^3)MediumGraph, Bitmasks, Floyd-Warshall Algorithm, Backtracking
3108Minimum Cost Walk in Weighted GraphC++ PythonO(n + e + q)O(n)HardUnion Find
3112Minimum Time to Visit Disappearing NodesC++ PythonO(|E| * log|V|)O(|E|)MediumGraph, Dijkstra's Algorithm
3123Find Edges in Shortest PathsC++ PythonO(|E| * log|V|)O(|E|)HardGraph, Dijkstra's Algorithm
3235Check if the Rectangle Corner Is ReachableC++ PythonO(n^2)O(n)HardGraph, BFS, DFS, Union Find
3243Shortest Distance After Road Addition Queries IC++ PythonO(n^2)O(n^2)MediumGraph, Dijkstra's Algorithm, BFS
3244Shortest Distance After Road Addition Queries IIC++ PythonO(nlogn)O(n)HardGraph, BST, Sorted List
3265Count Almost Equal Pairs IC++ PythonO(n * l^2)O(n)MediumFreq Table, Combinatorics, Graph, BFS
3267Count Almost Equal Pairs IIC++ PythonO(n * l^4)O(n)HardFreq Table, Combinatorics, Graph, BFS
3276Select Cells in Grid With Maximum ScoreC++ PythonO(n^2 * max(n, r))O(n * max(n, r))Hardvariant of Maximum Compatibility Score SumHungarian Weighted Bipartite Matching, DP, Bitmasks


Geometry

#TitleSolutionTimeSpaceDifficultyTagNote
2101Detonate the Maximum BombsC++ PythonO(|V|^2 + \V| * |E|)O(\V| + |E|)MediumGraph, DFS, BFS


Simulation

#TitleSolutionTimeSpaceDifficultyTagNote
2061Number of Spaces Cleaning Robot CleanedC++ PythonO(m * n)O(1)Medium🔒
2162Minimum Cost to Set Cooking TimeC++ PythonO(1)O(1)Medium
2257Count Unguarded Cells in the GridC++ PythonO(m * n)O(m * n)MediumArray, Simulation
2303Calculate Amount Paid in TaxesC++ PythonO(n)O(1)EasySimulation
2507Smallest Value After Replacing With Sum of Prime FactorsC++ PythonO(s * logn)O(max_n^0.5)MediumNumber Theory, Simulation
2532Time to Cross a BridgeC++ PythonO(k + nlogk)O(k)HardHeap, Simulation
2534Time Taken to Cross the DoorC++ PythonO(n)O(n)Hard🔒Queue, Simulation
2593Find Score of an Array After Marking All ElementsC++ PythonO(nlogn)O(n)MediumSimulation, Sort, Hash Table
2596Check Knight Tour ConfigurationC++ PythonO(m * n)O(m * n)MediumSimulation, Hash Table
2682Find the Losers of the Circular GameC++ PythonO(n)O(n)EasyHash Table, Simulation
2751Robot CollisionsC++ PythonO(nlogn)O(n)HardSort, Simulation, Stack
2934Minimum Operations to Maximize Last Elements in ArraysC++ PythonO(n)O(1)MediumSimulation
2960Count Tested Devices After Test OperationsC++ PythonO(n)O(1)EasySimulation
3100Water Bottles IIC++ PythonO(sqrt(n))O(1)MediumSimulation
3168Minimum Number of Chairs in a Waiting RoomC++ PythonO(n)O(1)EasySimulation
3175Find The First Player to win K Games in a RowC++ PythonO(n)O(1)MediumSimulation
3248Snake in MatrixC++ PythonO(c)O(1)MediumSimulation


Constructive Algorithms

#TitleSolutionTimeSpaceDifficultyTagNote
2202Maximize the Topmost Element After K MovesC++ PythonO(min(n, k))O(1)MediumConstructive Algorithms
2335Minimum Amount of Time to Fill CupsC++ PythonO(1)O(1)EasyMath, Constructive Algorithms
2350Shortest Impossible Sequence of RollsC++ PythonO(n)O(k)HardConstructive Algorithms
2546Apply Bitwise Operations to Make Strings EqualC++ PythonO(n)O(1)MediumConstructive Algorithms
2358Maximum Number of Groups Entering a CompetitionC++ PythonO(1)O(1)MediumConstructive Algorithms, Math
2610Convert an Array Into a 2D Array With ConditionsC++ PythonO(n)O(n)MediumFreq Table, Constructive Algorithms
2647Color the Triangle RedC++ PythonO(n^2)O(1)Hard🔒Constructive Algorithms
2654Minimum Number of Operations to Make All Array Elements Equal to 1C++ PythonO(n^2)O(1)MediumMath, Number Theory, Constructive Algorithms
2728Count Houses in a Circular StreetC++ PythonO(k)O(1)Easy🔒Constructive Algorithms
2732Find a Good Subset of the MatrixC++ PythonO(m * 2^n)O(2^n)HardBitmasks, Constructive Algorithms, Greedy
2745Construct the Longest New StringC++ PythonO(1)O(1)MediumConstructive Algorithms, Math
2753Count Houses in a Circular Street IIC++ PythonO(k)O(1)Hard🔒Constructive Algorithms
2811Check if it is Possible to Split ArrayC++ PythonO(n)O(1)MediumConstructive Algorithms
2829Determine the Minimum Sum of a k-avoiding ArrayC++ PythonO(1)O(1)MediumGreedy, Constructive Algorithms, Math
2834Find the Minimum Possible Sum of a Beautiful ArrayC++ PythonO(1)O(1)MediumDetermine the Minimum Sum of a k-avoiding ArrayGreedy, Constructive Algorithms, Math
2849Determine if a Cell Is Reachable at a Given TimeC++ PythonO(1)O(1)MediumConstructive Algorithms, Math
2856Minimum Array Length After Pair RemovalsC++ PythonO(n)O(n)MediumFreq Table, Constructive Algorithms
3139Minimum Cost to Equalize ArrayC++ PythonO(n)O(1)HardConstructive Algorithms, Math
3260Find the Largest Palindrome Divisible by KC++ PythonO(n)O(1)HardString, Constructive Algorithms, Math


Design

#TitleSolutionTimeSpaceDifficultyTagNote
2013Detect SquaresC++ Pythonctor: O(1)
add: O(1)
count: O(n)
O(n)Medium
2034Stock Price FluctuationC++ Pythonctor: O(1)
update: O(logn)
current: O(1)
max: O(1)
min: O(1)
O(n)MediumSorted List, Heap
2043Simple Bank SystemC++ Pythonctor: O(1)
transer: O(1)
deposit: O(1)
withdraw: O(1)
O(1)Medium
2069Walking Robot Simulation IIC++ PythonO(1)O(1)MediumSimulation, Math
2080Range Frequency QueriesC++ Pythonctor: O(n)
query: O(logn)
O(n)MediumBinary Search
2102Sequentially Ordinal Rank TrackerC++ Pythonadd: O(logn)
get: O(logn)
O(n)HardSorted List
2166Design BitsetC++ Pythonctor: O(n)
fix: O(1)
fix: O(1)
unfix: O(1)
flip: O(1)
all: O(1)
one: O(1)
count: O(1)
toString: O(n)
O(n)Medium
2227Encrypt and Decrypt StringsC++ Pythonctor: O(m + d)
encrypt: O(n)
decrypt: O(n)
O(n)HardFreq Table
2241Design an ATM MachineC++ Pythonctor: O(1)
deposit: O(1)
withdraw: O(1)
O(1)MediumGreedy
2254Design Video Sharing PlatformC++ Pythonctor: O(1)
upload: O(logn + l)
remove: O(logn)
like: O(1)
dislike: O(1)
view: O(1)
getLikesAndDislikes: O(1)
getViews: O(1)
O(n * l)Hard🔒Heap
2276Count Integers in IntervalsC++ Pythonctor: O(1)
add: O(logn), amortized
Count: O(1)
O(n)HardSorted List
2286Booking Concert Tickets in GroupsC++ Pythonctor: O(n)
gather: O(logn)
scatter: O(logn), amortized
O(n)HardSegment Tree, Binary Search
2296Design a Text EditorC++ Pythonctor: O(1)
addText: O(l)
deleteText: O(k)
cursorLeft: O(k)
cursorRight: O(k)
O(n)HardStack
2336Smallest Number in Infinite SetC++ Pythonctor: O(1)
popSmallest: O(logn)
addBack: O(logn)
O(n)MediumHeap, BST
2349Design a Number Container SystemC++ Pythonctor: O(1)
change: O(logn)
find: O(1)
O(n)MediumSorted List, BST
2353Design a Food Rating SystemC++ Pythonctor: O(nlogn)
changeRating: O(logn)
highestRated: O(1)
O(n)MediumSorted List, BST
2408Design SQLC++ Pythonctor: O(t * max_m)
insertRow: O(m)
deleteRow: O(1)
selectCell: O(m)
O(d)Medium🔒Hash Table
2424Longest Uploaded PrefixC++ Pythonctor: O(1)
upload: O(1), amortized
longest: O(1)
O(n)MediumHash Table
2502Design Memory AllocatorC++ Pythonctor: O(1)
allocate: O(logn)
free: O(logn)
O(n)MediumSorted List
2526Find Consecutive Integers from a Data StreamC++ PythonO(1)O(1)MediumArray
2590Design a Todo ListC++ Pythonctor: O(1)
addTask: O(l + logn)
getAllTasks: O(r)
getTasksForTag: O(r * c)
completeTask: O(l + logn)
O(n * l)Medium🔒BST, Sorted List
2642Design Graph With Shortest Path CalculatorC++ Pythonctor: O(|V| + |E|)
addEdge: O(1)
shortestPath: O(|E| * log|V|)
O(|E|)HardDijkstra's Algorithm
2671Frequency TrackerC++ Pythonctor: O(1)
add: O(1)
deleteOne: O(1)
hasFrequency: O(1)
O(min(n, r))MediumFreq Table
3242Design Neighbor Sum ServiceC++ Pythonctor: O(n^2)
adjacentSum: O(1)
diagonalSum: O(1)
O(n^2)EasyHash Table


JS

#TitleSolutionTimeSpaceDifficultyTagNote
2618Check if Object Instance of ClassTypeScriptO(n)O(1)Medium
2619Array Prototype LastTypeScriptO(1)O(1)Easy
2620CounterTypeScriptO(1)O(1)Easy
2621SleepTypeScriptO(1)O(1)EasyPromise
2622Cache With Time LimitTypeScriptO(1)O(1)MediumHash Table
2623MemoizeTypeScriptO(1)O(1)MediumHash Table
2624Snail traversalTypeScriptO(m * n)O(1)Medium
2625Flatten Deeply Nested ArrayTypeScriptO(n)O(h)MediumDFS
2626Array Reduce TransformationTypeScriptO(n)O(1)Easy
2627DebounceTypeScriptO(1)O(1)Medium
2628JSON Deep EqualTypeScriptO(n)O(h)MediumDFS
2629Function CompositionTypeScriptO(n)O(1)Easy
2630Memoize IITypeScriptO(n)O(t)HardTrie
2631Group ByTypeScriptO(n)O(1)Medium
2632CurryTypeScriptO(n)O(n)Medium
2633Convert Object to JSON StringTypeScriptO(n)O(h)MediumDFS
2634Filter Elements from ArrayTypeScriptO(n)O(1)Easy
2635Apply Transform Over Each Element in ArrayTypeScriptO(n)O(1)Easy
2636Promise PoolTypeScriptO(c + n / c)O(c)MediumPromise
2637Promise Time LimitTypeScriptO(n)O(1)EasyPromise
2648Generate Fibonacci SequenceTypeScriptO(1)O(1)EasyDP
2649Nested Array GeneratorTypeScriptO(1)O(d)MediumDFS
2650Design Cancellable FunctionTypeScriptO(1)O(1)HardPromise
2665Counter IITypeScriptctor: O(1)
increment: O(1)
decrement: O(1)
reset: O(1)
O(1)Easy
2666Allow One Function CallTypeScriptO(1)O(1)Easy
2667Create Hello World FunctionTypeScriptO(1)O(1)Easy
2675Array of Objects to MatrixTypeScriptO(l * mlogm + m * n)O(l * m + m * n)MediumDFS
2676ThrottleTypeScriptO(1)O(1)Medium
2677Chunk ArrayTypeScriptO(n)O(1)Easy
2690Infinite Method ObjectTypeScriptO(1)O(1)Medium🔒Proxy
2691Immutability HelperTypeScriptO(1)O(1)Hard🔒Proxy
2692Make Object ImmutableTypeScriptO(1)O(1)Medium🔒Proxy
2693Call Function with Custom ContextTypeScriptO(1)O(1)MediumSymbol
2694Event EmitterTypeScriptsubscribe: O(1)
unsubscribe: O(1)
emit: O(n)
O(n)MediumOrdered Set
2695Array WrapperTypeScriptvalueOf: O(n)
toString: O(n)
O(1)Easy
2700Differences Between Two ObjectsTypeScriptO(n)O(h)MediumDFS
2703Return Length of Arguments PassedTypeScriptO(1)O(1)Easy
2704To Be Or Not To BeTypeScriptO(1)O(1)Easy
2705Compact ObjectTypeScriptO(n)O(h)MediumDFS
2715Execute Cancellable Function With DelayTypeScriptO(1)O(1)Easy
2721Execute Asynchronous Functions in ParallelTypeScriptO(n)O(n)MediumPromise
2722Join Two Arrays by IDTypeScriptO(mlogm + nlogn)O(1)MediumSort, Two Pointers
2723Add Two PromisesTypeScriptO(1)O(1)EasyPromise
2724Sort ByTypeScriptO(nlogn)O(1)EasySort
2725Interval CancellationTypeScriptO(1)O(1)Easy
2726Calculator with Method ChainingTypeScriptO(1)O(1)Easy
2727Is Object EmptyTypeScriptO(1)O(1)Easy
2754Bind Function to ContextTypeScriptO(1)O(1)Medium🔒Symbol
2755Deep Merge of Two ObjectsTypeScriptO(n + m)O(h)Medium🔒DFS
2756Query BatchingTypeScriptO(n)O(n)Hard🔒
2757Generate Circular Array ValuesTypeScriptO(1)O(1)Medium🔒Generator
2758Next DayTypeScriptO(1)O(1)Easy🔒
2759Convert JSON String to ObjectTypeScriptO(n)O(h)Hard🔒Stack
2774Array Upper BoundTypeScriptO(logn)O(1)Easy🔒Binary Search
2775Undefined to NullTypeScriptO(n)O(h)Medium🔒DFS
2776Convert Callback Based Function to Promise Based FunctionTypeScriptO(1)O(1)Medium🔒Promise
2777Date Range GeneratorTypeScriptO(1)O(1)Medium🔒Generator
2794Create Object from Two ArraysTypeScriptO(n)O(1)Easy🔒
2795Parallel Execution of Promises for Individual Results RetrievalTypeScriptO(n)O(n)Medium🔒Promise
2796Repeat StringTypeScriptO(n * t)O(n * t)Easy🔒String
2797Partial Function with PlaceholdersTypeScriptO(n)O(n)Medium🔒
2803Factorial GeneratorTypeScriptO(n)O(1)Easy🔒Generator
2804Array Prototype ForEachTypeScriptO(n)O(1)Easy🔒Symbol
2805Custom IntervalTypeScriptO(1)O(1)Medium🔒
2821Delay the Resolution of Each PromiseTypeScriptO(1)O(1)Easy🔒Promise
2822Inversion of ObjectTypeScriptO(n)O(1)Easy🔒
2823Deep Object FilterTypeScriptO(n)O(h)Medium🔒DFS


SQL

#TitleSolutionTimeSpaceDifficultyTagNote
2004The Number of Seniors and Juniors to Join the CompanyMySQLO(nlogn)O(n)Hard🔒
2010The Number of Seniors and Juniors to Join the Company IIMySQLO(nlogn)O(n)Hard🔒
2020Number of Accounts That Did Not StreamMySQLO(m + n)O(m + n)Medium🔒
2026Low-Quality ProblemsMySQLO(nlogn)O(n)Easy🔒
2041Accepted Candidates From the InterviewsMySQLO(m + n)O(m + n)Medium🔒
2051The Category of Each Member in the StoreMySQLO(m + n)O(m + n)Medium🔒
2066Account BalanceMySQLO(nlogn)O(n)Medium🔒
2072The Winner UniversityMySQLO(n)O(n)Easy🔒
2082The Number of Rich CustomersMySQLO(n)O(n)Easy🔒
2084Drop Type 1 Orders for Customers With Type 0 OrdersMySQLO(nlogn)O(n)Medium🔒
2112The Airport With the Most TrafficMySQLO(n)O(n)Medium🔒
2118Build the EquationMySQLO(nlogn)O(n)Hard🔒
2142The Number of Passengers in Each Bus IMySQLO(p * b + blogb)O(p * b)Medium🔒
2153The Number of Passengers in Each Bus IIMySQLO(p * b + blogb)O(p * b)Hard🔒
2159Order Two Columns IndependentlyMySQLO(nlogn)O(n)Medium🔒
2173Longest Winning StreakMySQLO(nlogn)O(n)Hard🔒
2175The Change in Global RankingsMySQLO(nlogn)O(n)Medium🔒
2199Finding the Topic of Each PostMySQLO(n * mlogm)O(n * m)Hard🔒
2205The Number of Users That Are Eligible for DiscountMySQLO(n)O(n)Easy🔒
2228Users With Two Purchases Within Seven DaysMySQLO(nlogn)O(n)Medium🔒
2230The Users That Are Eligible for DiscountMySQLO(nlogn)O(n)Easy🔒
2238Number of Times a Driver Was a PassengerMySQLO(n)O(n)Medium🔒
2252Dynamic Pivoting of a TableMySQLO(n * m)O(n * m)Hard🔒
2253Dynamic Unpivoting of a TableMySQLO(n * m)O(n * m)Hard🔒
2292Products With Three or More Orders in Two Consecutive YearsMySQLO(nlogn)O(n)Medium🔒
2298Tasks Count in the WeekendMySQLO(n)O(n)Medium🔒
2308Arrange Table by GenderMySQLO(nlogn)O(n)Medium🔒
2314The First Day of the Maximum Recorded Degree in Each CityMySQLO(nlogn)O(n)Medium🔒
2324Product Sales Analysis IVMySQLO(nlogn)O(n)Medium🔒
2329Product Sales Analysis VMySQLO(nlogn)O(n)Medium🔒
2339All the Matches of the LeagueMySQLO(n^2)O(n^2)Easy🔒
2346Compute the Rank as a PercentageMySQLO(nlogn)O(n)Medium🔒
2356Number of Unique Subjects Taught by Each TeacherMySQLO(n)O(n)Easy🔒
2362Generate the InvoiceMySQLO(m + nlogn)O(n + m)Hard🔒
2372Calculate the Influence of Each SalespersonMySQLO(sp + c + s)O(sp + c + s)Medium🔒
2377Sort the Olympic TableMySQLO(nlogn)O(n)Easy🔒
2388Change Null Values in a Table to the Previous ValueMySQLO(nlogn)O(n)Medium🔒
2394Employees With DeductionsMySQLO(n)O(n)Medium🔒
2474Customers With Strictly Increasing PurchasesMySQLO(n)O(n)Hard🔒
2480Form a Chemical BondMySQLO(n^2)O(n)Easy🔒
2494Merge Overlapping Events in the Same HallMySQLO(nlogn)O(n)Hard🔒
2504Concatenate the Name and the ProfessionMySQLO(nlogn)O(n)Easy🔒
2668Find Latest SalariesMySQLO(nlogn)O(n)Easy🔒
2669Count Artist Occurrences On Spotify Ranking ListMySQLO(nlogn)O(n)Easy🔒
2686Immediate Food Delivery IIIMySQLO(nlogn)O(n)Medium🔒
2687Bikes Last Time UsedMySQLO(nlogn)O(n)Easy🔒
2688Find Active UsersMySQLO(nlogn)O(n)Medium🔒
2701Consecutive Transactions with Increasing AmountsMySQLO(nlogn)O(n)Hard🔒
2720Popularity PercentageMySQLO(n^2)O(n^2)Hard🔒
2738Count Occurrences in TextMySQLO(n)O(n)Medium🔒
2752Customers with Maximum Number of Transactions on Consecutive DaysMySQLO(nlogn)O(n)Hard🔒
2783Flight Occupancy and Waitlist AnalysisMySQLO(n * m + nlogn)O(n * m)Medium🔒
2793Status of Flight TicketsMySQLO(nlogn + m)O(n + m)Hard🔒
2820Election ResultsMySQLO(nlogn)O(n)Medium🔒
2837Total Traveled DistanceMySQLO(nlogn)O(n)Easy🔒
2853Highest Salaries DifferenceMySQLO(n)O(n)Easy🔒
2854Rolling Average StepsMySQLO(nlogn)O(n)Medium🔒
2893Calculate Orders Within Each IntervalMySQLO(nlogn)O(n)Medium🔒
2922Market Analysis IIIMySQLO(nlogn)O(n)Medium🔒
2978Symmetric CoordinatesMySQLO(nlogn)O(n)Medium🔒
2984Find Peak Calling Hours for Each CityMySQLO(nlogn)O(n)Medium🔒
2985Calculate Compressed MeanMySQLO(n)O(n)Easy🔒
2986Find Third TransactionMySQLO(nlogn)O(n)Medium🔒
2987Find Expensive CitiesMySQLO(nlogn)O(n)Easy🔒
2988Manager of the Largest DepartmentMySQLO(nlogn)O(n)Medium🔒
2989Class PerformanceMySQLO(n)O(n)Medium🔒
2990Loan TypesMySQLO(nlogn)O(n)Easy🔒
2991Top Three WineriesMySQLO(nlogn)O(n)Hard🔒
2993Friday Purchases IMySQLO(nlogn)O(n)Medium🔒
2994Friday Purchases IIMySQLO(nlogn)O(n)Hard🔒
2995Viewers Turned StreamersMySQLO(nlogn)O(n)Hard🔒
3050Pizza Toppings Cost AnalysisMySQLO(n^3 * logn)O(n^3)Medium🔒
3051Find Candidates for Data Scientist PositionMySQLO(nlogn)O(n)Easy🔒
3052Maximize ItemsMySQLO(n)O(n)Hard🔒
3053Classifying Triangles by LengthsMySQLO(n)O(n)Easy🔒
3054Binary Tree NodesMySQLO(nlogn)O(n)Medium🔒
3055Top Percentile FraudMySQLO(nlogn)O(n)Medium🔒
3056Snaps AnalysisMySQLO(n)O(n)Medium🔒
3057Employees Project AllocationMySQLO(nlogn)O(n)Hard🔒
3058Friends With No Mutual FriendsMySQLO(n^2 * logn)O(n^2)Medium🔒
3059Find All Unique Email DomainsMySQLO(nlogn)O(n)Easy🔒
3060User Activities within Time BoundsMySQLO(nlogn)O(n)Hard🔒
3061Calculate Trapping Rain WaterMySQLO(nlogn)O(n)Hard🔒
3087Find Trending HashtagsMySQLO(nlogn)O(n)Medium🔒
3089Find Bursty BehaviorMySQLO(nlogn)O(n)Medium🔒Window Function
3103Find Trending Hashtags IIMySQLO(n * l^2 + (n * l) * log(n * l))O(n * l^2)Hard🔒Recursive CTE
3118Friday Purchase IIIMySQLO(n)O(n)Medium🔒
3124Find Longest CallsMySQLO(nlogn)O(n)Medium🔒Window Function
3126Server Utilization TimeMySQLO(nlogn)O(n)MediumWindow Function
3140Consecutive Available Seats IIMySQLO(nlogn)O(n)Medium🔒Window Function
3150Invalid Tweets IIMySQLO(n * l + nlogn)O(n * l)Easy🔒String
3156Employee Task Duration and Concurrent TasksMySQLO(nlogn)O(n)Hard🔒Line Sweep
3166Calculate Parking Fees and DurationMySQLO(nlogn)O(n)Medium🔒
3172Second Day VerificationMySQLO(nlogn)O(n)Easy🔒
3182Find Top Scoring StudentsMySQLO(nlogn)O(n)Medium🔒
3188Find Top Scoring Students IIMySQLO(nlogn)O(n)Hard🔒
3198Find Cities in Each StateMySQLO(nlogn)O(n)Easy🔒
3204Bitwise User Permissions AnalysisMySQLO(n)O(n)Medium🔒
3214Year on Year Growth RateMySQLO(nlogn)O(n)Hard🔒Window Function
3220Odd and Even TransactionsMySQLO(nlogn)O(n)Medium
3230Customer Purchasing Behavior AnalysisMySQLO(nlogn)O(n)Medium🔒Window Function
3236CEO Subordinate HierarchyMySQLO(nlogn)O(n)Hard🔒Recursive CTE, BFS
3246Premier League Table RankingMySQLO(nlogn)O(n)Easy🔒Window Function
3252Premier League Table Ranking IIMySQLO(nlogn)O(n)Medium🔒Window Function
3262Find Overlapping ShiftsMySQLO(nlogn)O(n)Medium🔒Line Sweep
3268Find Overlapping Shifts IIMySQLO(n^2)O(n^2)Hard🔒Line Sweep, Window Function, Combinatorics
3278Find Candidates for Data Scientist Position IIMySQLO(p * s * n + p * nlogn + plogp)O(p * s * n)Medium🔒Window Function

PD

#TitleSolutionTimeSpaceDifficultyTagNote
2877Create a DataFrame from ListPython3O(n)O(1)Easy
2878Get the Size of a DataFramePython3O(1)O(1)Easy
2879Display the First Three RowsPython3O(1)O(1)Easy
2880Select DataPython3O(n)O(n)Easy
2881Create a New ColumnPython3O(n)O(1)Easy
2882Drop Duplicate RowsPython3O(n)O(n)Easy
2883Drop Missing DataPython3O(n)O(1)Easy
2884Modify ColumnsPython3O(n)O(1)Easy
2885Rename ColumnsPython3O(n)O(1)Easy
2886Change Data TypePython3O(n)O(1)Easy
2887Fill Missing DataPython3O(n)O(1)Easy
2888Reshape Data: ConcatenatePython3O(n + m)O(1)Easy
2889Reshape Data: PivotPython3O(n)O(1)Easy
2890Reshape Data: MeltPython3O(n)O(1)Easy
2891Method ChainingPython3O(nlogn)O(n)Easy