brain

tamnd's digital brain — notes, problems, research

42641 notes

LeetCode 1788 - Maximize the Beauty of the Garden

We are given an integer array flowers, where each element represents the beauty value of a flower in a line. We may remove any flowers we want, while preserving the relative order of the remaining flowers. After removals, the remaining sequence must form a valid garden.

leetcodehardarrayhash-tablegreedyprefix-sum
LeetCode 267 - Palindrome Permutation II

The problem asks us to generate every unique palindrome that can be formed by rearranging the characters of a given string. A palindrome is a string that reads the same forward and backward. For example, "abba" and "racecar" are palindromes.

leetcodemediumhash-tablestringbacktracking
LeetCode 1608 - Special Array With X Elements Greater Than or Equal X

The problem gives us an array nums containing non-negative integers. We need to determine whether there exists an intege

leetcodeeasyarraybinary-searchsorting
LeetCode 673 - Number of Longest Increasing Subsequence

The problem asks us to determine how many longest strictly increasing subsequences exist in a given integer array. A subsequence is formed by deleting zero or more elements without changing the relative order of the remaining elements.

leetcodemediumarraydynamic-programmingbinary-indexed-treesegment-tree
LeetCode 985 - Sum of Even Numbers After Queries

The problem gives us an integer array nums and a list of update operations called queries. Each query contains two values: - vali, the amount to add - indexi, the position in the array to update For every query, we must first update the array element: After applying the update…

leetcodemediumarraysimulation
CF 30B - Codeforces World Finals

We are given two dates in the format DD.MM.YY: one representing the day of the Codeforces World Finals and the other representing Bob's date of birth. Bob can rearrange the components of his birth date-the day, month, and year-but only as complete numbers, not individual digits.

codeforcescompetitive-programmingimplementation
LeetCode 258 - Add Digits

The problem asks us to repeatedly transform a number by summing its digits until only a single digit remains. The final single digit should then be returned. For example, if the input is 38, we first compute 3 + 8 = 11.

leetcodeeasymathsimulationnumber-theory
LeetCode 1566 - Detect Pattern of Length M Repeated K or More Times

The problem gives us an integer array arr and two integers, m and k. We need to determine whether there exists a contiguous subarray of length m that repeats consecutively at least k times.

leetcodeeasyarrayenumeration
LeetCode 837 - New 21 Game

In this problem, Alice repeatedly draws random numbers until her score reaches at least k. Every draw independently produces an integer between 1 and maxPts, inclusive, and each value is equally likely.

leetcodemediummathdynamic-programmingsliding-windowprobability-and-statistics
LeetCode 1829 - Maximum XOR for Each Query

The problem gives us a sorted array nums and an integer maximumBit. For every query, we must choose a number k such that: - 0 <= k < 2^maximumBit - The value of: is as large as possible.

leetcodemediumarraybit-manipulationprefix-sum
LeetCode 968 - Binary Tree Cameras

This problem asks us to determine the minimum number of cameras required to monitor all nodes in a binary tree. Each camera placed on a node can monitor its parent, itself, and its immediate children.

leetcodeharddynamic-programmingtreedepth-first-searchbinary-tree
LeetCode 926 - Flip String to Monotone Increasing

The problem asks us to transform a binary string into a monotone increasing string using the minimum number of character flips. A binary string is considered monotone increasing if all 0s appear before all 1s. In other words, once a 1 appears, no 0 can appear after it.

leetcodemediumstringdynamic-programming
LeetCode 846 - Hand of Straights

The problem asks us to determine whether a given collection of cards can be rearranged into groups of consecutive numbers, each of size groupSize.

leetcodemediumarrayhash-tablegreedysorting
LeetCode 990 - Satisfiability of Equality Equations

The problem is asking us to determine if a set of equations between single-letter variables can all be satisfied simultaneously. Each equation is either of the form "xi==yi" or "xi!=yi", where xi and yi are lowercase letters from 'a' to 'z'.

leetcodemediumarraystringunion-findgraph-theory
LeetCode 1681 - Minimum Incompatibility

The problem is asking us to partition an integer array nums into exactly k subsets of equal size, such that no subset co

leetcodehardarrayhash-tabledynamic-programmingbit-manipulationbitmask
LeetCode 793 - Preimage Size of Factorial Zeroes Function

This problem asks us to determine how many non-negative integers x exist such that the factorial of x ends with exactly k trailing zeroes. The function f(x) counts trailing zeroes in x!. For example, f(3) = 0 because 3! = 6 has no trailing zeroes, and f(11) = 2 because 11!

leetcodehardmathbinary-search
CF 130H - Balanced brackets

We are asked to determine if a string of round brackets is balanced. A balanced sequence is one where every opening bracket «(» has a corresponding closing bracket «)», and brackets are properly nested.

codeforcescompetitive-programming*special
LeetCode 910 - Smallest Range II

The problem gives us an integer array nums and an integer k. For every element in the array, we must choose exactly one of two operations: - add k - subtract k After modifying every element, we calculate the score of the array, which is defined as: Our goal is to minimize this…

leetcodemediumarraymathgreedysorting
LeetCode 711 - Number of Distinct Islands II

In this problem, we are given a binary matrix where each cell contains either 0 or 1. A value of 1 represents land, while 0 represents water. An island is formed by connecting adjacent land cells in the four cardinal directions: up, down, left, and right.

leetcodehardarrayhash-tabledepth-first-searchbreadth-first-searchunion-findsortingmatrixhash-function
LeetCode 1392 - Longest Happy Prefix

The problem asks us to find the longest substring that is both a prefix and a suffix of the given string s, while also e

leetcodehardstringrolling-hashstring-matchinghash-function
LeetCode 1243 - Array Transformation

The problem requires simulating the transformation of an array over consecutive days according to a simple local rule. Each day, every element of the array (except the first and last) is compared with its immediate neighbors.

leetcodeeasyarraysimulation
LeetCode 717 - 1-bit and 2-bit Characters

In this problem, we are given a binary array called bits. The array represents a sequence of encoded characters using the following rules: - A one-bit character is represented by a single 0 - A two-bit character is represented by either 10 or 11 The array is guaranteed to end…

leetcodeeasyarray
LeetCode 230 - Kth Smallest Element in a BST

This problem gives us the root of a Binary Search Tree, abbreviated as BST, along with an integer k. We need to return the kth smallest value in the tree. A Binary Search Tree has a very important property: - Every value in the left subtree is smaller than the current node.

leetcodemediumtreedepth-first-searchbinary-search-treebinary-tree
LeetCode 1617 - Count Subtrees With Max Distance Between Cities

The input describes an undirected tree with n cities. Since the graph is a tree, there are exactly n - 1 edges and there is a unique simple path between every pair of cities. The problem asks us to examine every possible connected subset of cities.

leetcodeharddynamic-programmingbit-manipulationtreeenumerationbitmask
LeetCode 353 - Design Snake Game

The problem asks us to design a mutable data structure that simulates the classic Snake game. The game is played on a rectangular grid with dimensions height x width. The snake starts at the top-left corner (0, 0) and initially has length 1.

leetcodemediumarrayhash-tabledesignqueuesimulation
CF 20A - BerOS file system

We are given a filesystem path as a string. In this operating system, multiple consecutive '/' characters are treated exactly the same as a single '/'. That means paths like ///home//user///docs and /home/user/docs refer to the same location.

codeforcescompetitive-programmingimplementation
LeetCode 1663 - Smallest String With A Given Numeric Value

The problem asks us to construct a lowercase string of length n such that the sum of the numeric values of its character

leetcodemediumstringgreedy
LeetCode 742 - Closest Leaf in a Binary Tree

The problem asks us to find the closest leaf node to a given target node k in a binary tree. The input is the root of a binary tree where each node has a unique integer value. A leaf node is defined as any node without children.

leetcodemediumtreedepth-first-searchbreadth-first-searchbinary-tree
LeetCode 1248 - Count Number of Nice Subarrays

The problem asks us to count how many contiguous subarrays contain exactly k odd numbers. We are given an integer array

leetcodemediumarrayhash-tablemathsliding-windowprefix-sum
LeetCode 669 - Trim a Binary Search Tree

LeetCode 669, Trim a Binary Search Tree, asks us to modify a binary search tree so that every remaining node has a value within the inclusive range [low, high].

leetcodemediumtreedepth-first-searchbinary-search-treebinary-tree
LeetCode 645 - Set Mismatch

The problem describes a corrupted set of integers. Originally, the set contained every number from 1 through n exactly once. Because of an error, one number was duplicated, which means one other number disappeared.

leetcodeeasyarrayhash-tablebit-manipulationsorting
LeetCode 803 - Bricks Falling When Hit

This problem asks us to simulate a sequence of brick removals in a 2D grid, while determining how many additional bricks become unstable and fall after each removal.

leetcodehardarrayunion-findmatrix
CF 120J - Minimum Sum

We are given a set of points in two-dimensional space, where each point can be thought of as a vector from the origin. Each vector has two coordinates, x and y, and we are allowed to independently flip the sign of each coordinate.

codeforcescompetitive-programmingdivide-and-conquergeometrysortings
LeetCode 720 - Longest Word in Dictionary

This problem gives us an array of lowercase English words and asks us to find the longest word that can be constructed one character at a time using other words from the same dictionary. More specifically, suppose we have a candidate word like "world".

leetcodemediumarrayhash-tablestringtriesorting
LeetCode 1149 - Article Views II

The problem gives us a database table named Views. Each row represents a single viewing event where a user viewed an article on a specific date.

leetcodemediumdatabase
LeetCode 785 - Is Graph Bipartite?

The problem asks whether a given undirected graph is bipartite. In simpler terms, we are given a graph represented as an adjacency list graph, where graph[u] lists all nodes directly connected to node u.

leetcodemediumdepth-first-searchbreadth-first-searchunion-findgraph-theory
LeetCode 320 - Generalized Abbreviation

This problem asks us to generate every possible generalized abbreviation of a given word. A generalized abbreviation is created by replacing some characters in the string with their count, while preserving the order of the remaining characters.

leetcodemediumstringbacktrackingbit-manipulation
LeetCode 69 - Sqrt(x)

The problem asks us to compute the integer square root of a non negative integer x. More specifically, we need to return the largest integer k such that: This means we are not looking for the exact decimal square root. Instead, we must round down to the nearest integer.

leetcodeeasymathbinary-search
LeetCode 117 - Populating Next Right Pointers in Each Node II

The problem asks us to populate the next pointer for every node in a binary tree so that it points to the node immediately to its right on the same level. If no such node exists, the next pointer should remain NULL.

leetcodemediumlinked-listtreedepth-first-searchbreadth-first-searchbinary-tree
LeetCode 823 - Binary Trees With Factors

The problem asks us to determine the number of distinct binary trees that can be constructed from a given array of unique integers, where each integer is strictly greater than 1.

leetcodemediumarrayhash-tabledynamic-programmingsorting
LeetCode 287 - Find the Duplicate Number

The problem gives us an integer array nums of length n + 1, where every value is guaranteed to be in the range [1, n]. Since there are n + 1 numbers but only n possible distinct values, at least one number must appear more than once. The task is to return that duplicate value.

leetcodemediumarraytwo-pointersbinary-searchbit-manipulation
LeetCode 775 - Global and Local Inversions

The problem presents an array nums of length n that is a permutation of integers from 0 to n-1. A global inversion is defined as any pair (i, j) such that i < j and nums[i] nums[j], meaning the earlier element is larger than a later element anywhere in the array.

leetcodemediumarraymath
LeetCode 1082 - Sales Analysis I

This problem asks us to identify the seller or sellers who generated the highest total sales revenue. We are given two database tables: Product and Sales. The Product table contains information about products, including their IDs, names, and unit prices.

leetcodeeasydatabase
LeetCode 944 - Delete Columns to Make Sorted

The problem gives us an array of strings where every string has exactly the same length. If we place all strings vertically, character by character, the strings form a rectangular grid.

leetcodeeasyarraystring
CF 50C - Happy Farm 5

We have a set of points on a 2D plane representing cows, each with integer coordinates. Vasya, the shepherd, must walk a closed path around all the cows in such a way that every cow lies strictly inside the path. The goal is to minimize the number of moves needed.

codeforcescompetitive-programminggeometry
LeetCode 1355 - Activity Participants

This problem asks us to analyze participation counts for different activities and return only the activities whose parti

leetcodemediumdatabase
LeetCode 894 - All Possible Full Binary Trees

The problem asks us to generate every possible full binary tree that contains exactly n nodes. A full binary tree is a special kind of binary tree where every node has either exactly two children or no children at all. In other words, a node can never have only one child.

leetcodemediumdynamic-programmingtreerecursionmemoizationbinary-tree
LeetCode 1145 - Binary Tree Coloring Game

The problem is a two-player game played on a binary tree, where each player colors nodes starting from an initial chosen node. Player 1 picks a node x and colors it red, while Player 2 picks a different node y and colors it blue.

leetcodemediumtreedepth-first-searchbinary-tree
LeetCode 227 - Basic Calculator II

The problem gives us a string representing a mathematical expression containing non-negative integers, spaces, and the four operators +, -, , and /. Our task is to evaluate the expression and return the resulting integer value.

leetcodemediummathstringstack
LeetCode 1361 - Validate Binary Tree Nodes

The problem gives us n nodes labeled from 0 to n - 1. For every node i, we are told which node is its left child and which node is its right child through the arrays leftChild and rightChild. If leftChild[i] = x, then node x is the left child of node i.

leetcodemediumtreedepth-first-searchbreadth-first-searchunion-findgraph-theorybinary-tree
LeetCode 1094 - Car Pooling

This problem asks us to determine whether a car can successfully complete a series of passenger trips without ever exceeding its seating capacity.

leetcodemediumarraysortingheap-(priority-queue)simulationprefix-sum
CF 63A - Sinking Ship

We are given a list of people standing in a fixed left-to-right order on a sinking ship. Every person has a name and a role. The evacuation order depends entirely on the role priority. Rats leave first. Women and children share the next priority level. Men leave after them.

codeforcescompetitive-programmingimplementationsortingsstrings
LeetCode 79 - Word Search

In this problem, we are given a two dimensional grid of characters called board and a target string called word. The task is to determine whether the word can be formed by traversing the grid under a strict set of movement rules.

leetcodemediumarraystringbacktrackingdepth-first-searchmatrix
LeetCode 449 - Serialize and Deserialize BST

The problem asks us to design two operations for a Binary Search Tree, abbreviated as BST: - serialize(root) converts the BST into a string representation. - deserialize(data) reconstructs the exact same BST from that string.

leetcodemediumstringtreedepth-first-searchbreadth-first-searchdesignbinary-search-treebinary-tree
LeetCode 728 - Self Dividing Numbers

The problem asks us to find all numbers within a given inclusive range [left, right] that satisfy the definition of a self-dividing number. A self-dividing number has two important properties: 1. Every digit inside the number must divide the number evenly. 2.

leetcodeeasymath
LeetCode 651 - 4 Keys Keyboard

The problem gives us a keyboard with four operations: - Press A, which inserts one character 'A' - Press Ctrl-A, which selects everything currently on the screen - Press Ctrl-C, which copies the selected text into a clipboard buffer - Press Ctrl-V, which pastes the clipboard…

leetcodemediummathdynamic-programming
CF 107A - Dorm Water Supply

The houses and pipes form a directed graph with a very special structure. Every house can have at most one incoming pipe and at most one outgoing pipe. That restriction changes the graph from a general directed graph into a collection of independent chains.

codeforcescompetitive-programmingdfs-and-similargraphs
CF 17E - Palisection

We are given a string and we consider every palindromic substring inside it. Each occurrence matters separately, even if two substrings have the same text. For example, in "aaa" there are three different occurrences of "a".

codeforcescompetitive-programmingstrings
LeetCode 120 - Triangle

The problem gives us a triangular array of integers and asks us to compute the minimum path sum from the top row to the bottom row. The input is a two-dimensional array called triangle, where: - The first row contains exactly one number.

leetcodemediumarraydynamic-programming
CF 72F - Oil

We have an n × m grid. Some entire rows are empty, some entire columns are empty, and every empty cell belongs to at least one of those empty rows or empty columns. All remaining cells contain oil.

codeforcescompetitive-programming*specialgreedymath
LeetCode 1063 - Number of Valid Subarrays

The problem is asking us to count the number of valid subarrays in a given integer array nums. A subarray is valid if its leftmost element is not larger than any other element in the subarray.

leetcodehardarraystackmonotonic-stack
LeetCode 1234 - Replace the Substring for Balanced String

The problem asks us to balance a string composed of exactly four types of characters: 'Q', 'W', 'E', and 'R'. A string is balanced when each character occurs exactly n / 4 times, where n is the length of the string.

leetcodemediumstringsliding-window
LeetCode 97 - Interleaving String

This problem asks us to determine whether a string s3 can be formed by interleaving two other strings, s1 and s2. An interleaving means we combine characters from s1 and s2 while preserving the relative order of characters within each original string.

leetcodemediumstringdynamic-programming
CF 7C - Line

We are asked to find an integer point on a straight line described by the equation Ax + By + C = 0. The inputs are three integers, A, B, and C, which define the slope and position of the line.

codeforcescompetitive-programmingmathnumber-theory
CF 45A - Codecraft III

We are given the current month as a string and an integer k representing how many months later a new game release will happen. The task is to determine the month after advancing exactly k months forward in the calendar.

codeforcescompetitive-programmingimplementation
LeetCode 187 - Repeated DNA Sequences

This problem asks us to find all repeated DNA subsequences of a fixed length, specifically length 10, inside a given DNA string. The input is a string s, where each character represents a DNA nucleotide.

leetcodemediumhash-tablestringbit-manipulationsliding-windowrolling-hashhash-function
LeetCode 2233 - Maximum Product After K Increments

The problem asks us to maximize the product of an array of non-negative integers after performing at most k increment op

leetcodemediumarraygreedyheap-(priority-queue)
LeetCode 86 - Partition List

It looks like you want the full detailed solution guide, but the specific LeetCode problem number and statement are missing from your latest request template. You included the formatting instructions and structure, but not which problem to solve beyond prior context.

leetcodemediumlinked-listtwo-pointers
LeetCode 1043 - Partition Array for Maximum Sum

The problem gives us an integer array arr and an integer k. We are allowed to partition the array into contiguous subarrays where each subarray has length at most k.

leetcodemediumarraydynamic-programming
LeetCode 33 - Search in Rotated Sorted Array

The problem gives us an array that was originally sorted in ascending order, but may have been rotated at some pivot point. A rotation means that some prefix of the sorted array was moved to the end while preserving the relative order of elements.

leetcodemediumarraybinary-search
LeetCode 499 - The Maze III

This problem extends the mechanics introduced in earlier Maze problems, but adds two important complications. First, we are no longer looking for a simple reachable or unreachable answer. Instead, we must find the shortest path by travel distance.

leetcodehardarraystringdepth-first-searchbreadth-first-searchgraph-theoryheap-(priority-queue)matrixshortest-path
CF 46B - T-shirts from Sponsor

We are given a limited stock of T-shirts in five sizes: S, M, L, XL, and XXL. Each participant in the contest has a preferred size. Participants arrive in a fixed order and try to pick the T-shirt closest to their preferred size.

codeforcescompetitive-programmingimplementation
LeetCode 1139 - Largest 1-Bordered Square

That is a long, detailed reference document with multiple required sections, complete implementations, worked traces, and test coverage. I can provide the full guide in a single response.

leetcodemediumarraydynamic-programmingmatrix
LeetCode 1238 - Circular Permutation in Binary Representation

This problem asks us to construct a special ordering of all integers from 0 to 2^n - 1. The ordering must satisfy the properties of a circular Gray code sequence.

leetcodemediummathbacktrackingbit-manipulation
LeetCode 1384 - Total Sales Amount by Year

This is a SQL database problem where we need to calculate the total sales amount per product for each year, even when a

leetcodeharddatabase
LeetCode 1476 - Subrectangle Queries

The problem asks us to design a class called SubrectangleQueries that operates on a two dimensional integer matrix, refe

leetcodemediumarraydesignmatrix
LeetCode 1699 - Number of Calls Between Two Persons

This problem provides a database table named Calls, where each row represents a phone call between two people. The table contains three columns: | Column | Meaning | | --- | --- | | fromid | The caller | | toid | The receiver | | duration | Duration of the call | The important…

leetcodemediumdatabase
CF 22D - Segments

We are given several closed intervals on the number line. A nail placed at an integer coordinate covers every segment that contains that coordinate, including endpoints.

codeforcescompetitive-programminggreedysortings
LeetCode 1683 - Invalid Tweets

This problem gives us a database table named Tweets with two columns: | Column | Description | | --- | --- | | tweetid |

leetcodeeasydatabase
CF 38F - Smart Boy

We start with an empty string. The first player picks any single letter that appears somewhere inside at least one dictionary word. After that, players alternately extend the current string by adding exactly one character either to the front or to the back.

codeforcescompetitive-programmingdpgamesstrings
LeetCode 724 - Find Pivot Index

The problem asks us to find an index in the array such that the sum of all elements strictly to the left of that index is equal to the sum of all elements strictly to the right of that index. More formally, for an index i: - Left sum = nums[0] + nums[1] + ...

leetcodeeasyarrayprefix-sum
CF 128A - Statues

We have an 8 × 8 board. Maria starts in the bottom-left corner, Anna stays permanently in the top-right corner, and several statues occupy other cells. The game proceeds in rounds. Maria moves first, then every statue moves one row downward simultaneously.

codeforcescompetitive-programmingdfs-and-similar
LeetCode 1749 - Maximum Absolute Sum of Any Subarray

The problem asks us to calculate the maximum absolute sum of any contiguous subarray in a given integer array nums. A subarray is a sequence of consecutive elements, and its absolute sum is defined as the absolute value of the sum of all elements in that subarray.

leetcodemediumarraydynamic-programming
LeetCode 2921 - Maximum Profitable Triplets With Increasing Prices II

The problem asks us to select three items from a store such that their prices are strictly increasing and their indices

leetcodehardarraybinary-indexed-treesegment-tree
CF 36C - Bowls

Each bowl is a frustum, a cone with its tip cut off. A bowl is described by its height h, bottom radius r, and top radius R. The bowls are stacked in the given order, always sharing the same vertical axis.

codeforcescompetitive-programminggeometryimplementation
LeetCode 1031 - Maximum Sum of Two Non-Overlapping Subarrays

The problem gives us an integer array nums and two fixed subarray lengths, firstLen and secondLen. We must select exactly two contiguous subarrays such that: - One subarray has length firstLen - The other subarray has length secondLen - The two subarrays do not overlap - The…

leetcodemediumarraydynamic-programmingsliding-window
LeetCode 1546 - Maximum Number of Non-Overlapping Subarrays With Sum Equals Target

This problem asks us to find the maximum number of non-overlapping subarrays in a given integer array nums such that the

leetcodemediumarrayhash-tablegreedyprefix-sum
LeetCode 766 - Toeplitz Matrix

The problem asks us to determine whether a given matrix satisfies the Toeplitz property. A matrix is considered Toeplitz if every diagonal running from the top-left corner toward the bottom-right corner contains identical values.

leetcodeeasyarraymatrix
LeetCode 1417 - Reformat The String

The problem gives us an alphanumeric string s that contains only lowercase English letters and digits. Our task is to re

leetcodeeasystring
CF 91A - Newspaper Headline

We have a source string s1, which represents the headline of one newspaper. We may take as many copies of this headline as we want and concatenate them together.

codeforcescompetitive-programminggreedystrings
LeetCode 2016 - Maximum Difference Between Increasing Elements

The problem is asking us to find the maximum difference between two elements in an array, with the condition that the smaller element appears before the larger element.

leetcodeeasyarray
LeetCode 689 - Maximum Sum of 3 Non-Overlapping Subarrays

The problem asks us to select exactly three non-overlapping subarrays from the input array nums, where each subarray has length k. Among all valid choices, we must maximize the total sum of all elements contained in those three subarrays.

leetcodehardarraydynamic-programmingsliding-windowprefix-sum
LeetCode 1301 - Number of Paths with Max Score

In this problem, we are given an n x n board where each cell contains one of four possible values: - 'E', the ending position located at the top-left corner - 'S', the starting position located at the bottom-right corner - A digit character '1' through '9', representing points…

leetcodehardarraydynamic-programmingmatrix
CF 29D - Ant on the Tree

We are asked to construct a path for an ant on a tree. The tree has n vertices, with vertex 1 as the root, and n-1 edges connecting them so the graph is connected.

codeforcescompetitive-programmingconstructive-algorithmsdfs-and-similartrees
LeetCode 1480 - Running Sum of 1d Array

The problem asks us to compute the running sum, also called the prefix sum, of a one dimensional integer array. For ever

leetcodeeasyarrayprefix-sum
CF 64G - Path Canonization

We are given an absolute Unix-style path. The path is split into components by /, and every component represents either a normal directory or file name, ".", or "..". A normal name means “go into this directory or file”. The component ".

codeforcescompetitive-programming*special
LeetCode 555 - Split Concatenated Strings

The problem gives an array of strings, and we must arrange them into a circular concatenation while preserving the original order of the strings. For every individual string, we are allowed to either keep it as-is or reverse it before joining it into the loop.

leetcodemediumarraystringgreedy
LeetCode 85 - Maximal Rectangle

The problem asks us to find the area of the largest rectangle containing only 1s in a binary matrix. The matrix consists of characters '0' and '1', where '1' represents a valid cell that may belong to a rectangle and '0' represents a blocked cell that cannot be included.

leetcodehardarraydynamic-programmingstackmatrixmonotonic-stack
LeetCode 1111 - Maximum Nesting Depth of Two Valid Parentheses Strings

The problem asks us to take a valid parentheses string seq and split it into two disjoint subsequences A and B such that each subsequence is itself a valid parentheses string (VPS).

leetcodemediumstringstack
LeetCode 430 - Flatten a Multilevel Doubly Linked List

The problem gives us a special type of doubly linked list where every node contains four fields: The next and prev pointers behave exactly like a normal doubly linked list. The extra child pointer introduces another linked list that branches downward from the current node.

leetcodemediumlinked-listdepth-first-searchdoubly-linked-list