2100 - 2199
Solutions categorised by Problem IDs
2140 - Solving Questions With BrainpowerMaximize exam points by comparing the reward from answering each question with the best score from skipping it.2108 - Find First Palindromic String in the ArrayFind the first palindromic word in array order by checking each candidate for symmetry.2109 - Adding Spaces to a StringInsert spaces at specified positions by advancing through the string and the ordered list of insertion indices together.2110 - Number of Smooth Descent Periods of a StockCount smooth descent periods by tracking runs in which each price is exactly one lower than the preceding price.2111 - Minimum Operations to Make the Array K-IncreasingMinimize replacements for a k-increasing array by finding a longest nondecreasing subsequence in each stride-k group.2119 - A Number After a Double ReversalDecide whether reversing an integer twice recovers it by checking the effect of trailing zeroes.2120 - Execution of All Suffix Instructions Staying in a GridCount executable moves for every instruction suffix by tracking when the robot would first leave the grid.2121 - Intervals Between Identical ElementsSum the distances to equal values at every array position by grouping their indices and using prefix sums.2122 - Recover the Original ArrayRecover the original array by testing candidate offsets and pairing each shifted value with its required counterpart.2127 - Maximum Employees to Be Invited to a MeetingFind the largest possible meeting by analyzing favorite-person cycles and chains that feed into mutual pairs.2131 - Longest Palindrome by Concatenating Two Letter WordsBuild the longest palindrome from two-letter words by matching reversed pairs and choosing a possible center.2144 - Minimum Cost of Buying Candies With DiscountMinimize the cost of candies under a buy-two-get-one discount by choosing groups in descending price order.2145 - Count the Hidden SequencesCount valid starting values for a hidden sequence by tracking the minimum and maximum cumulative differences.2146 - K Highest Ranked Items Within a Price RangeRank reachable items by distance, price, and position by exploring the grid with breadth-first search.2147 - Number of Ways to Divide a Long CorridorCount corridor partitions with exactly two seats per section by multiplying the available divider choices between seat pairs.2148 - Count Elements With Strictly Smaller and Greater ElementsCount array elements strictly between the minimum and maximum using the order of the sorted values.2149 - Rearrange Array Elements by SignRearrange values into alternating positive and negative positions while preserving their order within each sign group.2150 - Find All Lonely Numbers in the ArrayFind values that occur once and have neither adjacent integer present by checking a frequency table.2151 - Maximum Good People Based on StatementsMaximize the number of good people by enumerating assignments and checking each good person's statements for consistency.2154 - Keep Multiplying Found Values by TwoKeep doubling a starting value while it appears in the array, using a set to test each new value.2155 - All Divisions With the Highest Score of a Binary ArrayFind all best binary-array split points by tracking zeroes on the left and ones on the right.2156 - Find Substring With Given Hash ValueFind the first substring with a specified polynomial hash by updating a rolling hash from right to left.2160 - Minimum Sum of Four Digit Number After Splitting DigitsMinimize the sum of two numbers made from four digits by sorting the digits and placing the smallest in the tens positions.2161 - Partition Array According to Given PivotPartition an array into values below, equal to, and above a pivot while preserving order within the groups.2162 - Minimum Cost to Set Cooking TimeMinimize microwave keypad cost by evaluating valid minute-second representations and their movement and button-press costs.2163 - Minimum Difference in Sums After Removal of ElementsMinimize the difference between two retained sums by maintaining the best prefix and suffix selections with two heaps.2164 - Sort Even and Odd Indices IndependentlySort values at even indices in ascending order and values at odd indices in descending order, then interleave them.2165 - Smallest Value of the Rearranged NumberRearrange digits to form the smallest signed integer by handling negative values and leading zeroes separately.2166 - Design BitsetImplement a bitset with updates, flips, count queries, and string conversion while tracking which bits are set.2167 - Minimum Time to Remove All Cars Containing Illegal GoodsMinimize the time to remove illegal goods by comparing individual removals with deleting cars from either end.2169 - Count Operations to Obtain ZeroCount subtraction operations until either integer becomes zero by repeatedly subtracting the smaller from the larger.2170 - Minimum Operations to Make the Array AlternatingMinimize changes to make an array alternating by comparing the most frequent values at even and odd positions.2171 - Removing Minimum Number of Magic BeansMinimize bean removals by sorting bag sizes and testing which common size to retain in all nonempty bags.2172 - Maximum AND Sum of ArrayMaximize the AND sum when assigning values to slots with limited capacity using bit-mask dynamic programming or flow.2176 - Count Equal and Divisible Pairs in an ArrayCount equal-valued index pairs whose index product is divisible by k by testing pairs directly.2177 - Find Three Consecutive Integers That Sum to a Given NumberFind three consecutive integers with a given sum by determining whether the sum has an integer middle value.2178 - Maximum Split of Positive Even IntegersSplit an even sum into as many distinct positive even integers as possible by choosing small values greedily.2179 - Count Good Triplets in an ArrayCount triples that appear in the same relative order in two permutations using index mappings and a binary indexed tree.2180 - Count Integers With Even Digit SumCount positive integers up to a bound whose decimal digits have an even sum by evaluating each candidate.2183 - Count Array Pairs Divisible by KCount pairs of distinct indices whose corresponding array values have a product divisible by k.2185 - Counting Words With a Given PrefixCount the words that begin with a given prefix by checking the beginning of each candidate.2186 - Minimum Number of Steps to Make Two Strings Anagram IICount how many characters must be appended to make two strings anagrams by comparing their character frequencies.2187 - Minimum Time to Complete TripsFind the minimum time needed for all trips by binary searching time and counting completed trips at each candidate.2188 - Minimum Time to Finish the RaceMinimize race time by combining the best runs on one tire with the cost of changing tires between runs.2190 - Most Frequent Number Following Key In an ArrayFind the most frequent value immediately following a given key by counting its successors in array order.2191 - Sort the Jumbled NumbersSort numbers by their remapped decimal digits while preserving the relative order of equal mapped values.2192 - All Ancestors of a Node in a Directed Acyclic GraphFind every node's ancestors in a directed acyclic graph using topological ordering or depth-first search.2193 - Minimum Number of Moves to Make PalindromeCount adjacent swaps needed to make a palindrome by matching characters from opposite ends and moving them into place.2194 - Cells in a Range on an Excel SheetList all spreadsheet cells in a rectangular range by iterating over its columns and rows in the requested order.2195 - Append K Integers With Minimal SumChoose the k smallest missing positive integers and sum them by accounting for gaps between existing values.2196 - Create Binary Tree From DescriptionsBuild a binary tree from parent-child descriptions by mapping values to nodes and identifying the root.2197 - Replace Non-Coprime Numbers in ArrayRepeatedly merge adjacent non-coprime numbers into their least common multiple until no further merge applies.2200 - Find All K-Distant Indices in an ArrayFind indices within k positions of a key occurrence by checking distances to matching array entries.2201 - Count Artifacts That Can Be ExtractedCount extractable artifacts by checking whether every cell in each artifact's rectangular footprint has been dug.2202 - Maximize the Topmost Element After K MovesFind the largest attainable stack top after exactly k moves by considering which elements can be exposed or returned.2203 - Minimum Weighted Subgraph With the Required PathsMinimize the weight of two routes to a common destination by combining distances from both sources and to the destination.2206 - Divide Array Into Equal PairsDecide whether all array values can be grouped into equal pairs by checking the multiplicity of each value.2207 - Maximize Number of Subsequences in a StringMaximize the count of a two-character subsequence by comparing the gains from inserting either pattern character.