LeetCode 29xx
LeetCode problems 2900–2999
LeetCode 29xx
| # | Problem | Difficulty | Time | Notes |
|---|---|---|---|---|
| 2900 | Longest Unequal Adjacent Groups Subsequence I | 🟢 Easy | 1m 21s | We are given two arrays of the same length: - words[i] is a string.… |
| 2901 | Longest Unequal Adjacent Groups Subsequence II | 🟡 Medium | 37s | The problem asks us to select the longest subsequence of words from… |
| 2902 | Count of Sub-Multisets With Bounded Sum | 🔴 Hard | 48s | The problem asks us to count all possible sub-multisets of an array… |
| 2903 | Find Indices With Index and Value Difference I | 🟢 Easy | 1m 5s | The problem asks us to find two indices i and j in the array such t… |
| 2904 | Shortest and Lexicographically Smallest Beautiful String | 🟡 Medium | 1m 1s | We are given a binary string s, meaning the string contains only th… |
| 2905 | Find Indices With Index and Value Difference II | 🟡 Medium | 54s | The problem asks us to find two indices i and j in an integer array… |
| 2906 | Construct Product Matrix | 🟡 Medium | 1m 12s | The problem asks us to construct a new matrix p from a given matrix… |
| 2907 | Maximum Profitable Triplets With Increasing Prices I | 🟡 Medium | 1m 49s | This problem asks us to select exactly three items from a store whi… |
| 2908 | Minimum Sum of Mountain Triplets I | 🟢 Easy | 1m 1s | The problem asks us to find the minimum possible sum of a "mountain… |
| 2909 | Minimum Sum of Mountain Triplets II | 🟡 Medium | 1m 21s | The problem asks us to find three indices (i, j, k) such that the m… |
| 2910 | Minimum Number of Groups to Create a Valid Assignment | 🟡 Medium | 1m 19s | This problem gives us an array of integers representing balls. Ball… |
| 2911 | Minimum Changes to Make K Semi-palindromes | 🔴 Hard | 1m 10s | The problem asks us to partition a given string s into k contiguous… |
| 2912 | Number of Ways to Reach Destination in the Grid | 🔴 Hard | 1m 32s | We are given an n × m grid and two cells: - source = [sx, sy] - des… |
| 2913 | Subarrays Distinct Element Sum of Squares I | 🟢 Easy | 1m 20s | The problem asks us to examine every possible non-empty subarray of… |
| 2914 | Minimum Number of Changes to Make Binary String Beautiful | 🟡 Medium | 1m 10s | You are given a binary string s whose length is guaranteed to be ev… |
| 2915 | Length of the Longest Subsequence That Sums to Target | 🟡 Medium | 1m 26s | The problem gives us an array nums and an integer target. We must f… |
| 2916 | Subarrays Distinct Element Sum of Squares II | 🔴 Hard | 1m 51s | The problem asks us to consider every possible non-empty subarray o… |
| 2917 | Find the K-or of an Array | 🟢 Easy | 1m 20s | This problem introduces a generalized version of the bitwise OR ope… |
| 2918 | Minimum Equal Sum of Two Arrays After Replacing Zeros | 🟡 Medium | 1m 10s | The problem gives us two integer arrays, nums1 and nums2, where som… |
| 2919 | Minimum Increment Operations to Make Array Beautiful | 🟡 Medium | 1m 19s | The problem asks us to transform an input integer array nums into a… |
| 2920 | Maximum Points After Collecting Coins From All Nodes | 🔴 Hard | 1m 30s | We are given a tree with n nodes rooted at node 0. Each node contai… |
| 2921 | Maximum Profitable Triplets With Increasing Prices II | 🔴 Hard | 1m 29s | The problem asks us to select three items from a store such that th… |
| 2922 | Market Analysis III | 🟡 Medium | 1m 22s | The problem asks us to analyze three relational tables: Users, Item… |
| 2923 | Find Champion I | 🟢 Easy | 1m 6s | This problem describes a tournament of n teams, where every pair of… |
| 2924 | Find Champion II | 🟡 Medium | 1m 20s | This problem models a tournament as a directed acyclic graph (DAG).… |
| 2925 | Maximum Score After Applying Operations on a Tree | 🟡 Medium | 1m 23s | The problem gives us an undirected tree with n nodes rooted at node… |
| 2926 | Maximum Balanced Subsequence Sum | 🔴 Hard | 59s | This problem asks us to find the maximum sum of a balanced subseque… |
| 2927 | Distribute Candies Among Children III | 🔴 Hard | 1m 19s | We are given two integers, n and limit. There are exactly three chi… |
| 2928 | Distribute Candies Among Children I | 🟢 Easy | 51s | The problem asks us to calculate the number of ways to distribute n… |
| 2929 | Distribute Candies Among Children II | 🟡 Medium | 56s | The problem asks us to calculate the total number of ways to distri… |
| 2930 | Number of Strings Which Can Be Rearranged to Contain Substring | 🟡 Medium | 54s | The problem asks us to count how many strings of length n made of l… |
| 2931 | Maximum Spending After Buying Items | 🔴 Hard | 1m 27s | We are given an m × n matrix values where each row represents a sho… |
| 2932 | Maximum Strong Pair XOR I | 🟢 Easy | 1m 21s | The problem gives us an integer array nums, and we must choose two … |
| 2934 | Minimum Operations to Maximize Last Elements in Arrays | 🟡 Medium | 1m 17s | You are given two arrays, nums1 and nums2, both of the same length … |
| 2935 | Maximum Strong Pair XOR II | 🔴 Hard | 1m 2s | The problem asks us to find the maximum XOR value of a strong pair … |
| 2936 | Number of Equal Numbers Blocks | 🟡 Medium | 1m 3s | The problem is asking us to count the number of maximal contiguous … |
| 2937 | Make Three Strings Equal | 🟢 Easy | 1m 6s | The problem asks us to make three strings s1, s2, and s3 identical … |
| 2938 | Separate Black and White Balls | 🟡 Medium | 55s | The problem asks us to determine the minimum number of adjacent swa… |
| 2939 | Maximum Xor Product | 🟡 Medium | 59s | That will be quite long and detailed given your required structure … |
| 2933 | High-Access Employees | 🟡 Medium | 2m 22s | The problem gives us a list of employee access records. Each record… |
| 2934 | Minimum Operations to Maximize Last Elements in Arrays | 🟡 Medium | 1m 15s | The problem gives us two integer arrays, nums1 and nums2, both of t… |
| 2935 | Maximum Strong Pair XOR II | 🔴 Hard | 45s | The problem is asking us to find the maximum XOR value among all st… |
| 2936 | Number of Equal Numbers Blocks | 🟡 Medium | 45s | This problem asks us to count the number of contiguous blocks of eq… |
| 2937 | Make Three Strings Equal | 🟢 Easy | 1m | The problem gives us three strings, s1, s2, and s3. In one operatio… |
| 2938 | Separate Black and White Balls | 🟡 Medium | 41s | The problem asks us to rearrange a binary string representing balls… |
| 2939 | Maximum Xor Product | 🟡 Medium | 1m 14s | We are given three integers, a, b, and n. We must choose an integer… |
| 2940 | Find Building Where Alice and Bob Can Meet | 🔴 Hard | 1m 22s | You are given an array heights, where each index represents a build… |
| 2941 | Maximum GCD-Sum of a Subarray | 🔴 Hard | 1m 1s | The problem asks us to find the maximum gcd-sum of a subarray of a … |
| 2942 | Find Words Containing Character | 🟢 Easy | 57s | The problem asks us to process an array of lowercase strings words … |
| 2943 | Maximize Area of Square Hole in Grid | 🟡 Medium | 1m 21s | The grid is formed by n + 2 horizontal bars and m + 2 vertical bars… |
| 2944 | Minimum Number of Coins for Fruits | 🟡 Medium | 1m 32s | This problem asks us to determine the minimum number of coins requi… |
| 2945 | Find Maximum Non-decreasing Array Length | 🔴 Hard | 56s | This problem asks us to determine the maximum length of a non-decre… |
| 2946 | Matrix Similarity After Cyclic Shifts | 🟢 Easy | 1m 9s | This problem asks us to determine whether a matrix remains identica… |
| 2947 | Count Beautiful Substrings I | 🟡 Medium | 1m 9s | We are given a lowercase English string s and a positive integer k.… |
| 2948 | Make Lexicographically Smallest Array by Swapping Elements | 🟡 Medium | 52s | The problem asks us to transform a given array of positive integers… |
| 2949 | Count Beautiful Substrings II | 🔴 Hard | 56s | The problem asks us to find the number of non-empty substrings in a… |
| 2950 | Number of Divisible Substrings | 🟡 Medium | 50s | The problem asks us to analyze a given string word where each lower… |
| 2951 | Find the Peaks | 🟢 Easy | 40s | The problem is asking us to identify all the peaks in a given array… |
| 2952 | Minimum Number of Coins to be Added | 🟡 Medium | 1m 1s | The problem asks us to determine the minimum number of coins we nee… |
| 2953 | Count Complete Substrings | 🔴 Hard | 1m 54s | The problem asks us to count how many substrings of a given string … |
| 2954 | Count the Number of Infection Sequences | 🔴 Hard | 1m 12s | This problem asks us to compute the number of valid infection seque… |
| 2955 | Number of Same-End Substrings | 🟡 Medium | 1m 48s | The problem asks us to compute the number of same-end substrings wi… |
| 2956 | Find Common Elements Between Two Arrays | 🟢 Easy | 1m 4s | This problem asks us to compare two integer arrays and count how ma… |
| 2957 | Remove Adjacent Almost-Equal Characters | 🟡 Medium | 2m 43s | We are given a string word consisting of lowercase English letters.… |
| 2958 | Length of Longest Subarray With at Most K Frequency | 🟡 Medium | 48s | The problem asks us to find the length of the longest contiguous su… |
| 2959 | Number of Possible Sets of Closing Branches | 🔴 Hard | 59s | This problem asks us to determine the number of possible sets of br… |
| 2960 | Count Tested Devices After Test Operations | 🟢 Easy | 52s | This problem asks us to simulate a sequence of device tests based o… |
| 2961 | Double Modular Exponentiation | 🟡 Medium | 1m 7s | The problem gives us a 0-indexed 2D array called variables, where e… |
| 2962 | Count Subarrays Where Max Element Appears at Least K Times | 🟡 Medium | 57s | The problem asks us to count subarrays in an integer array nums whe… |
| 2963 | Count the Number of Good Partitions | 🔴 Hard | 1m 36s | The problem asks us to count the number of ways we can partition a … |
| 2964 | Number of Divisible Triplet Sums | 🟡 Medium | 1m 17s | The problem gives us an integer array nums and an integer d. We mus… |
| 2965 | Find Missing and Repeated Values | 🟢 Easy | 1m 3s | The problem gives us an n x n matrix called grid. Every value in th… |
| 2966 | Divide Array Into Arrays With Max Difference | 🟡 Medium | 55s | The problem asks us to divide an integer array nums of size n (wher… |
| 2967 | Minimum Cost to Make Array Equalindromic | 🟡 Medium | 1m 45s | We are given an integer array nums. We may repeatedly choose any el… |
| 2968 | Apply Operations to Maximize Frequency Score | 🔴 Hard | 1m 19s | This problem asks us to maximize the frequency of the most common v… |
| 2969 | Minimum Number of Coins for Fruits II | 🔴 Hard | 2m 32s | The problem asks us to determine the minimum number of coins requir… |
| 2970 | Count the Number of Incremovable Subarrays I | 🟢 Easy | 49s | The problem asks us to count all subarrays of a given array nums su… |
| 2971 | Find Polygon With the Largest Perimeter | 🟡 Medium | 1m 9s | The problem gives us an array nums containing positive integers. Ea… |
| 2972 | Count the Number of Incremovable Subarrays II | 🔴 Hard | 1m 21s | The problem gives us an array nums of positive integers and asks us… |
| 2973 | Find Number of Coins to Place in Tree Nodes | 🔴 Hard | 52s | The problem gives us a tree with n nodes labeled from 0 to n - 1. T… |
| 2974 | Minimum Number Game | 🟢 Easy | 1m 6s | The problem gives us an integer array nums with an even number of e… |
| 2975 | Maximum Square Area by Removing Fences From a Field | 🟡 Medium | 1m 21s | The field is represented as a large rectangle whose outer boundarie… |
| 2976 | Minimum Cost to Convert String I | 🟡 Medium | 1m 29s | This problem asks us to transform one string into another while min… |
| 2977 | Minimum Cost to Convert String II | 🔴 Hard | 31s | That is a very large, comprehensive request for a Hard problem, wit… |
| 2978 | Symmetric Coordinates | 🟡 Medium | 1m 8s | This problem asks us to identify symmetric coordinate pairs from a … |
| 2979 | Most Expensive Item That Can Not Be Bought | 🟡 Medium | 51s | This problem asks us to determine the largest price that cannot be … |
| 2976 | Minimum Cost to Convert String I | 🟡 Medium | 4m 51s | This problem asks us to transform one string into another while min… |
| 2977 | Minimum Cost to Convert String II | 🔴 Hard | 1m 37s | This problem asks us to transform one string into another while min… |
| 2978 | Symmetric Coordinates | 🟡 Medium | 51s | The problem asks us to identify symmetric coordinates from a table … |
| 2979 | Most Expensive Item That Can Not Be Bought | 🟡 Medium | 45s | This problem is asking us to determine the largest price of an item… |
| 2980 | Check if Bitwise OR Has Trailing Zeros | 🟢 Easy | 52s | The problem asks us to determine whether we can select two or more … |
| 2981 | Find Longest Special Substring That Occurs Thrice I | 🟡 Medium | 1m 21s | The problem asks us to find the longest special substring that appe… |
| 2982 | Find Longest Special Substring That Occurs Thrice II | 🟡 Medium | 1m 4s | The problem asks us to find the maximum length of a special substri… |
| 2983 | Palindrome Rearrangement Queries | 🔴 Hard | 1m 51s | We are given a string s of even length n. For every query, we are a… |
| 2984 | Find Peak Calling Hours for Each City | 🟡 Medium | 51s | The problem is asking us to analyze call records from a Calls table… |
| 2985 | Calculate Compressed Mean | 🟢 Easy | 59s | This problem asks us to compute the average number of items per ord… |
| 2986 | Find Third Transaction | 🟡 Medium | 1m 36s | The problem gives us a Transactions table that stores three pieces … |
| 2987 | Find Expensive Cities | 🟢 Easy | 1m | This problem provides a database table named Listings that contains… |
| 2988 | Manager of the Largest Department | 🟡 Medium | 54s | You included two different problems in one message, and the second … |
| 2989 | Class Performance | 🟡 Medium | 45s | The problem asks us to calculate the difference between the highest… |
| 2990 | Loan Types | 🟢 Easy | 54s | The problem requires identifying users who have taken both a "Refin… |
| 2991 | Top Three Wineries | 🔴 Hard | 54s | The problem asks us to determine the top three wineries in each cou… |
| 2992 | Number of Self-Divisible Permutations | 🟡 Medium | 1m 17s | The problem asks us to count how many permutations of the numbers 1… |
| 2993 | Friday Purchases I | 🟡 Medium | 56s | The problem asks us to compute the total amount spent on Fridays in… |
| 2994 | Friday Purchases II | 🔴 Hard | 49s | The problem requires calculating the total spending by users on eac… |
| 2995 | Viewers Turned Streamers | 🔴 Hard | 2m 52s | We are given a database table called Sessions, where each row repre… |
| 2996 | Smallest Missing Integer Greater Than Sequential Prefix Sum | 🟢 Easy | 1m 5s | The problem asks us to find the smallest missing integer in the arr… |
| 2997 | Minimum Number of Operations to Make Array XOR Equal to K | 🟡 Medium | 59s | This problem asks us to transform an array so that the bitwise XOR … |
| 2998 | Minimum Number of Operations to Make X and Y Equal | 🟡 Medium | 1m 3s | The problem asks us to transform an integer x into another integer … |
| 2999 | Count the Number of Powerful Integers | 🔴 Hard | 43s | The problem asks us to count all integers within a given range [sta… |
| 2995 | Viewers Turned Streamers | 🔴 Hard | 46s | This problem involves analyzing a database table Sessions that reco… |
| 2997 | Minimum Number of Operations to Make Array XOR Equal to K | 🟡 Medium | 47s | This problem asks us to determine the minimum number of bit flips r… |
| 2998 | Minimum Number of Operations to Make X and Y Equal | 🟡 Medium | 1m 32s | This problem gives us two positive integers, x and y, and asks for … |
| 2999 | Count the Number of Powerful Integers | 🔴 Hard | 1m 5s | The problem asks us to count all integers in a given range [start, … |