识别信号
- Do you identify both odd and even length palindromes during center expansion?
- Can you explain how previously computed palindromes reduce redundant checks in the DP table?
- Assess understanding of dynamic programming, especially with state transitions.
解题流程
- 1. 明确窗口/状态定义
- 2. 更新状态并维护约束
- 3. 用边界样例验证
常见失分点
- Forgetting to check even-length palindromes, which requires treating centers between characters.
- Failing to handle edge cases like empty string `s` or pattern `p` properly.
- Failing to properly balance the number of opening and closing parentheses during backtracking leads to invalid sequences.
推荐题单梯度
最长回文子串
Find the longest contiguous palindromic substring in a given string using dynamic programming and two-pointer expansion …
正则表达式匹配
The Regular Expression Matching problem involves checking if a string matches a pattern using '.' and '*'.
括号生成
Generate Parentheses requires generating all valid combinations of parentheses with given pairs using backtracking and s…
最长有效括号
Compute the length of the longest well-formed parentheses substring using state transition dynamic programming and stack…
接雨水
Calculate the total trapped rain water using the elevation map array, leveraging dynamic programming and two-pointer pat…
通配符匹配
Implement full wildcard pattern matching using '?' and '*' by applying state transition dynamic programming with careful…
跳跃游戏 II
Jump Game II requires finding the minimum jumps to reach the end of an array using dynamic programming and greedy techni…
最大子数组和
Maximum Subarray is a classic state transition dynamic programming problem about deciding whether to extend or restart a…
跳跃游戏
Solve the Jump Game problem using state transition dynamic programming to determine if you can reach the last index of t…
不同路径
Calculate the number of unique paths for a robot to move on an m x n grid with only right and down movements.
不同路径 II
Calculate the number of unique paths from top-left to bottom-right in a grid with obstacles using dynamic programming st…
最小路径和
Compute the minimum sum from top-left to bottom-right in a grid using state transition dynamic programming efficiently.
爬楼梯
Climbing Stairs is a classic dynamic programming problem where you calculate distinct ways to reach the top using step t…
编辑距离
Determine the minimum number of insertions, deletions, or replacements to transform one string into another using dynami…
最大矩形
Compute the largest rectangle of 1's in a binary matrix using dynamic programming and stack-based state transitions effi…
扰乱字符串
Scramble String is a dynamic programming problem where we determine if one string can be scrambled to form another using…
解码方法
Decode Ways is a dynamic programming problem focused on decoding a numeric string to letters using specific mappings.
交错字符串
The Interleaving String problem requires determining if a string can be formed by interleaving two others, utilizing dyn…
不同的子序列
Compute the number of distinct subsequences of one string matching another using precise state transition dynamic progra…
杨辉三角
Generate the first numRows of Pascal's Triangle using dynamic programming with clear state transitions and array manipul…
杨辉三角 II
Compute the specific row of Pascal's Triangle using efficient state transition dynamic programming with array-based upda…
三角形最小路径和
Given a triangle, return the minimum path sum from top to bottom, moving to adjacent numbers in the row below.
买卖股票的最佳时机
Maximize stock profit by identifying the optimal buy and sell days using dynamic programming.
买卖股票的最佳时机 II
Maximize stock profit by using a greedy approach to buy and sell multiple times, with state transition dynamic programmi…
买卖股票的最佳时机 III
Determine the maximum profit from at most two stock transactions using state transition dynamic programming on price arr…
分割回文串
Find all possible palindrome partitioning of a string using backtracking and dynamic programming.
分割回文串 II
Determine the minimum cuts required to partition a string into all palindromic substrings using dynamic programming tech…
乘积最大子数组
Find the subarray with the largest product in an integer array using dynamic programming techniques.
地下城游戏
Calculate the minimum initial health the knight needs to survive the dungeon using state transition dynamic programming …
买卖股票的最佳时机 IV
Determine the maximum profit from at most k stock transactions using state transition dynamic programming on an array of…
打家劫舍
Maximize the amount of money you can rob tonight without alerting the police by applying dynamic programming with state …
打家劫舍 II
Maximize your loot by robbing houses arranged in a circle without alerting the police using dynamic programming.
最大正方形
Maximal Square is a matrix-based dynamic programming problem that focuses on finding the largest square filled with 1's.
数字 1 的个数
Compute the total number of digit one appearing in all numbers from 0 up to n using state transition dynamic programming…
为运算表达式设计优先级
Solve Different Ways to Add Parentheses by splitting on each operator and memoizing every subexpression result list.
丑数 II
Find the nth ugly number, where ugly numbers have prime factors limited to 2, 3, and 5.
完全平方数
Perfect Squares asks for the least number of perfect squares summing to a given integer n using dynamic programming or B…
最长递增子序列
Solve the Longest Increasing Subsequence problem using dynamic programming and binary search to efficiently find the sub…
买卖股票的最佳时机含冷冻期
Maximize stock profit with cooldown restrictions using state transition dynamic programming to track buy, sell, and cool…
戳气球
Burst Balloons is a hard dynamic programming problem requiring careful state transitions to maximize coins collected eff…
超级丑数
Compute the nth super ugly number efficiently using dynamic programming with state transitions based on the given prime …
零钱兑换
Find the minimum number of coins needed to reach a target amount using dynamic programming state transitions efficiently…
比特位计数
Compute the number of 1 bits for every integer from 0 to n using state transition dynamic programming for efficiency.
整数拆分
Break an integer into the sum of positive integers to maximize the product using dynamic programming.
俄罗斯套娃信封问题
Russian Doll Envelopes is a dynamic programming problem that involves finding the longest chain of envelopes that can be…
统计各位数字都不同的数字个数
The problem asks to count numbers with unique digits from 0 to 10^n using dynamic programming, math, and backtracking te…
最大整除子集
Find the largest subset of distinct positive integers where every pair satisfies divisibility using state transition dyn…
猜数字大小 II
Minimize the maximum cost of guessing a number in a dynamic guessing game using optimal strategies.
摆动序列
Find the longest wiggle subsequence in an integer array using state transition dynamic programming with greedy optimizat…
组合总和 Ⅳ
Combination Sum IV asks to find the number of combinations that sum to a given target using elements from an array.
判断子序列
Determine if one string is a subsequence of another using state transition dynamic programming for accurate character ma…
旋转函数
Maximize the rotation function by rotating the array and calculating the weighted sum for all rotations.
整数替换
Find the minimum number of operations to reduce a number to 1 by applying specific operations, using state transition dy…
青蛙过河
Determine if a frog can cross a river using jumps constrained by previous step sizes in a dynamic programming state tran…
分割数组的最大值
Solve the 'Split Array Largest Sum' problem by minimizing the largest sum across k subarrays using dynamic programming a…
等差数列划分
Count the number of arithmetic subarrays in a given integer array using dynamic programming.
分割等和子集
Determine if an array can be partitioned into two subsets with equal sum using dynamic programming techniques.
无重叠区间
Determine the minimum number of intervals to remove from a list to ensure no intervals overlap using dynamic programming…
等差数列划分 II - 子序列
Count all arithmetic subsequences in an array using dynamic programming with precise state transitions for correctness.
可怜的小猪
Find the minimum number of pigs required to determine the poisonous bucket within a set time using state transition dyna…
我能赢吗
Determine if the first player can guarantee a win in a turn-based number selection game using state transition dynamic p…
统计重复个数
This problem requires counting how many times a repeated string s2 fits as a subsequence within a repeated string s1 usi…
环绕字符串中唯一的子字符串
Solve the 'Unique Substrings in Wraparound String' problem using dynamic programming with a state transition approach.
连接词
Find concatenated words by using dynamic programming and depth-first search to identify valid words made of other words …
火柴拼正方形
The problem asks to determine if we can use matchsticks to form a square, exploring dynamic programming and backtracking…
一和零
Solve the Ones and Zeroes problem using dynamic programming with state transition, focusing on array and string manipula…
预测赢家
Predict the Winner involves two players taking turns to maximize their score by picking from either end of an array, opt…
祖玛游戏
The Zuma Game involves clearing balls from the board using a limited hand, applying dynamic programming and state transi…
目标和
Target Sum requires counting all expressions from nums using '+' or '-' that evaluate exactly to the given target intege…
斐波那契数
Calculate the nth Fibonacci number using state transition dynamic programming and recursive techniques efficiently in in…
自由之路
Determine the minimum rotations and button presses to spell a keyword on a circular dial using state transition dynamic …
最长回文子序列
Find the length of the longest palindromic subsequence in a string using precise state transition dynamic programming.
零钱兑换 II
Calculate the number of unique coin combinations to reach a target amount using state transition dynamic programming eff…
优美的排列
The Beautiful Arrangement problem asks for the number of valid permutations of n integers satisfying specific divisibili…
01 矩阵
The '01 Matrix' problem challenges you to find the nearest zero for each cell in a binary matrix using dynamic programmi…
移除盒子
Maximize points by strategically removing contiguous same-colored boxes using state transition dynamic programming and m…
学生出勤记录 II
The Student Attendance Record II problem explores counting valid student attendance sequences using dynamic programming …
最优除法
Maximize the value of an expression by optimally placing parentheses for division operations.
出界的路径数
Calculate the number of ways a ball can exit a grid using dynamic programming with state transitions for every move comb…
两个字符串的删除操作
Find the minimum number of steps to make two strings equal by deleting characters, using dynamic programming.
不含连续1的非负整数
Count non-negative integers up to n without consecutive ones in their binary representation using dynamic programming.
K 个逆序对数组
The K Inverse Pairs Array problem focuses on counting arrays with exactly k inverse pairs using dynamic programming.
大礼包
Minimize the cost of purchasing items using available special offers with state transition dynamic programming.
解码方法 II
Decode Ways II is a challenging dynamic programming problem that involves decoding messages with digits and wildcard cha…
最长数对链
Determine the maximum length of a chain formed by pairs using dynamic programming and greedy sorting techniques efficien…
回文子串
Count all palindromic substrings in a given string using state transition dynamic programming for efficient evaluation.
两个键的键盘
Minimize the number of operations to get exactly 'n' characters on the screen using two operations: Copy All and Paste.
奇怪的打印机
Calculate the minimum turns a strange printer needs to print any string using state transition dynamic programming effic…
最长递增子序列的个数
This problem challenges you to find the number of longest increasing subsequences in a given array of integers.
有效的括号字符串
Solve the Valid Parenthesis String problem by leveraging state transition dynamic programming to handle parentheses and …
骑士在棋盘上的概率
Calculate the probability that a knight remains on an n x n chessboard after making exactly k moves using dynamic progra…
三个无重叠子数组的最大和
Maximize the sum of three non-overlapping subarrays with length k in an integer array using dynamic programming.
划分为k个相等的子集
Determine if an integer array can be partitioned into k subsets where each subset sums to the same value using DP and ba…
两个字符串的最小ASCII删除和
This problem focuses on minimizing the ASCII delete sum for two strings by using dynamic programming to find the lowest …
买卖股票的最佳时机含手续费
Maximize stock trading profits accounting for per-transaction fees using state transition dynamic programming and greedy…
最长重复子数组
Find the maximum length of a subarray that appears in both given integer arrays using dynamic programming.
统计不同回文子序列
Count Different Palindromic Subsequences leverages dynamic programming to count non-empty palindromic subsequences in a …
摘樱桃
Maximize cherries collected on a grid, employing state transition dynamic programming with careful navigation across obs…
使用最小花费爬楼梯
Compute the minimum cost to reach the top of a staircase using dynamic programming and step-by-step state transitions ef…
最大加号标志
Find the largest axis-aligned plus sign in a binary grid with some mines using dynamic programming.
滑动谜题
Determine the minimum moves to solve a 2x3 sliding puzzle using BFS and state transition dynamic programming techniques …
旋转数字
Count all integers from 1 to n that transform into a different valid number when each digit is rotated 180 degrees using…
多米诺和托米诺平铺
Calculate the number of ways to tile a 2xN board using dominoes and trominoes with precise state transitions.
香槟塔
Compute champagne levels in a pyramid of glasses using state transition dynamic programming for accurate distribution tr…
使序列递增的最小交换次数
This problem involves finding the minimum number of swaps needed to make two sequences strictly increasing using dynamic…
数组的均值分割
Determine whether an integer array can be partitioned into two non-empty subarrays with the same average using dynamic p…
分汤
Compute the probability that soup A empties before soup B using state transition dynamic programming efficiently.
最大平均值和的分组
Maximize the sum of averages by partitioning an integer array into at most k contiguous subarrays using dynamic programm…
赛车
Race Car is a dynamic programming problem where the goal is to find the shortest sequence of instructions to reach a tar…
统计子串中的唯一字符
Calculate the sum of unique characters in all substrings of a string using state transition dynamic programming.
新 21 点
Calculate the probability Alice reaches at most n points using state transition dynamic programming efficiently.
推多米诺
In the "Push Dominoes" problem, you simulate the falling dominoes based on their initial states and determine their fina…
数组中的最长山脉
Find the length of the longest subarray forming a mountain pattern using state transitions and two-pointer logic efficie…
最低加油次数
Determine the minimum number of refueling stops needed to reach a target using dynamic programming and greedy strategies…
石子游戏
Stone Game is a dynamic programming problem where players alternate taking stones from piles to maximize their score.
盈利计划
Given a group of members and a list of crimes, count the profitable schemes that meet the profit and group constraints.
鸡蛋掉落
Solve the Super Egg Drop problem using dynamic programming and binary search to minimize the number of moves required to…
子数组按位或操作
Compute the number of unique bitwise OR values from all non-empty subarrays using dynamic state transitions efficiently.
最大为 N 的数字组合
The 'Numbers At Most N Given Digit Set' problem requires calculating how many numbers can be formed using a given digit …
DI 序列的有效排列
The problem asks to find the number of valid permutations for a given DI sequence string using dynamic programming and s…
子数组的最小值之和
Calculate the sum of minimum values across all subarrays of a given array modulo 10^9 + 7.
环形子数组的最大和
Find the maximum sum of a circular subarray using state transition dynamic programming, optimizing for wraparound cases …
播放列表的数量
Solve the Number of Music Playlists problem with dynamic programming, focusing on state transitions and combinatorics to…
将字符串翻转到单调递增
Minimize the number of flips needed to make a binary string monotone increasing using dynamic programming.
下降路径最小和
Minimum Falling Path Sum is a matrix dynamic programming problem where each cell depends on three reachable cells above …
骑士拨号器
Solve the Knight Dialer problem using state transition dynamic programming to efficiently calculate valid number paths f…
不同的子序列 II
Find the number of distinct non-empty subsequences of a string using dynamic programming and state transitions.
最短超级串
This problem requires constructing the shortest string containing all input words using state transition dynamic program…
最高的广告牌
Solve the Tallest Billboard problem by using dynamic programming to find the maximum equal height for two disjoint rod s…
删列造序 III
The problem requires minimizing deletions to ensure all strings are lexicographically sorted. Use dynamic programming fo…
表示数字的最少运算符
Compute the minimum number of arithmetic operators to form a target using repeated x with addition, subtraction, multipl…
奇偶跳
Determine the number of valid starting indices in an array where you can reach the end with alternating odd and even jum…
最长湍流子数组
Find the length of the longest subarray where element comparisons alternate, using state transition dynamic programming …
最低票价
Solve the Minimum Cost For Tickets problem using state transition dynamic programming for optimal travel ticket purchase…
合并石头的最低成本
Minimize the cost to merge stones with k consecutive piles using dynamic programming to achieve the optimal solution.
至少有 1 位重复的数字
Solve Numbers With Repeated Digits by counting unique-digit numbers up to n, then subtracting from n using digit DP.
最佳观光组合
Compute the maximum sightseeing score efficiently using state transition dynamic programming and single-pass array itera…
视频拼接
Solve the "Video Stitching" problem using state transition dynamic programming to cover a sporting event with minimum cl…
除数博弈
Divisor Game is a game theory problem where players take turns subtracting divisors of a number n until one player loses…
两个无重叠子数组的最大和
Find the maximum sum of two non-overlapping subarrays by efficiently using state transition dynamic programming.
不相交的线
The Uncrossed Lines problem involves finding the maximum number of non-intersecting lines that can be drawn between two …
多边形三角剖分的最低得分
Compute the minimum total score to triangulate a convex polygon using state transition dynamic programming on vertex val…
分隔数组以得到最大和
Partition an array into subarrays of length at most k, replacing each with its maximum to maximize total sum efficiently…
最后一块石头的重量 II
In the 'Last Stone Weight II' problem, you need to find the minimal possible stone weight after a series of smashes usin…
最短公共超序列
Compute the shortest string containing both given strings as subsequences using state transition dynamic programming eff…
填充书架
Determine the minimum total height of a bookcase by placing books in order using state transition dynamic programming.
最小的必要团队
Find the smallest subset of people covering all required skills using bitmask dynamic programming for efficient state tr…
叶值的最小代价生成树
Compute the minimum sum of non-leaf nodes in a binary tree formed from array leaves using dynamic programming efficientl…
第 N 个泰波那契数
Compute the N-th Tribonacci number using state transition dynamic programming with careful memoization and iterative upd…
最大的以 1 为边界的正方形
Find the largest square of 1s with 1s on its borders in a binary grid using dynamic programming.
石子游戏 II
Stone Game II is a dynamic programming problem where Alice and Bob alternate taking stones from piles to maximize their …
最长公共子序列
Find the length of the longest common subsequence between two strings using state transition dynamic programming for eff…
段式回文
Solve the "Longest Chunked Palindrome Decomposition" problem by using dynamic programming and string manipulation techni…
掷骰子等于目标和的方法数
Calculate the number of ways to roll n dice with k faces to reach a target sum using state transition dynamic programmin…
地图分析
Find the farthest water cell from land in a grid and return the Manhattan distance using state transition dynamic progra…
删除一次得到子数组最大和
Find the maximum sum of a subarray with at most one deletion in this dynamic programming problem.
使数组严格递增
Determine the minimum operations to transform arr1 into a strictly increasing sequence using values from arr2 efficientl…
K 次串联后最大子数组之和
Solve the K-Concatenation Maximum Sum problem using dynamic programming and optimal sub-array sum calculation.
统计元音字母序列的数目
Count Vowels Permutation requires computing the number of valid vowel strings of length n using state transition dynamic…
掷骰子模拟
Calculate all valid sequences of n dice rolls with consecutive roll constraints using state transition dynamic programmi…
飞机座位分配概率
Calculate the probability that the last passenger sits in their assigned seat using state transition dynamic programming…
规划兼职工作
Compute the maximum profit from non-overlapping jobs using state transition dynamic programming with sorted arrays and b…
得分最高的单词集合
Calculate the highest total score by selecting words from a list using available letters, respecting individual letter s…
可被三整除的最大和
Find the maximum sum divisible by three from a given array using dynamic programming and state transition.
停在原地的方案数
Compute the exact number of ways to remain at index 0 after given steps using state transition dynamic programming.
统计全为 1 的正方形子矩阵
Count the number of square submatrices with all ones in a given binary matrix using dynamic programming.
分割回文串 III
Find the minimal character changes to split a string into k palindromes using precise dynamic programming state transiti…
下降路径最小和 II
Find the minimum sum of a falling path in a square matrix using dynamic programming while avoiding same-column selection…
最大得分的路径数目
Calculate the maximum score path and count all valid routes in a square board with obstacles using dynamic programming.
让字符串成为回文串的最少插入次数
The problem asks to find the minimum number of insertions to convert a string into a palindrome using dynamic programmin…
二指输入的的最小距离
Calculate the minimum total distance to type a word using two fingers on a keyboard, applying dynamic programming.
灌溉花园的最少水龙头数目
Determine the minimum number of taps to water an entire garden using state transition dynamic programming and interval c…
阈值距离内邻居最少的城市
Find the city with the fewest neighbors within a given threshold distance using dynamic programming.
工作计划的最低难度
Schedule jobs into multiple days to minimize the difficulty of the schedule using dynamic programming and state transiti…
跳跃游戏 V
Jump Game V is a hard dynamic programming problem that focuses on maximizing jumps between indices in an array.
参加考试的最大学生数
Calculate the maximum number of students who can take an exam without cheating using state transition dynamic programmin…
有效的快递序列数目
Count all valid pickup and delivery sequences for n orders where deliveries occur after pickups using dynamic programmin…
形成三的最大倍数
Find the largest number divisible by three by selecting and ordering digits optimally using state transition dynamic pro…
将整数按权重排序
Sort integers in a range based on their power value using dynamic programming and memoization, handling ties with ascend…
3n 块披萨
Maximize your pizza slice sum from a 3n-sized circular array using state transition dynamic programming efficiently.
统计作战单位数
Count the number of valid three-soldier teams using ratings with a state transition dynamic programming approach efficie…
找到所有好字符串
Find all good strings between two given strings without including a specified evil substring using dynamic programming.
做菜顺序
Maximize the sum of like-time coefficients by optimally choosing dishes to prepare in this dynamic programming problem.
石子游戏 III
Stone Game III is a challenging dynamic programming problem based on game theory and state transition logic.
给 N x 3 网格图涂色的方案数
Calculate the number of ways to paint a grid of size n x 3 with distinct adjacent colors using dynamic programming.
恢复数组
Calculate the number of arrays that can be restored from a string of digits where each number is within [1, k].
生成数组
This problem asks to build an array where the maximum element is found using exactly K comparisons, with dynamic program…
带限制的子序列和
Solve the Constrained Subsequence Sum problem using dynamic programming, sliding window, and priority queues to maximize…
每个人戴不同帽子的方案数
Calculate all unique assignments of hats to people using state transition dynamic programming with bitmasking for collis…
切披萨的方案数
This problem challenges you to determine the number of valid ways to cut a pizza into pieces with apples using dynamic p…
数位成本和为目标值的最大数字
Maximize the integer you can paint with given digit costs under a target sum, using dynamic programming to optimize the …
两个子序列的最大点积
Solve Max Dot Product of Two Subsequences with state transition dynamic programming that enforces a non-empty pairing de…
摘樱桃 II
Maximize cherry collection in a grid using two robots with careful state transition dynamic programming to optimize path…
两个盒子中球的颜色数相同的概率
Compute the probability that two boxes contain the same number of distinct balls using careful combinatorial and DP meth…
粉刷房子 III
Solve Paint House III using state transition dynamic programming to minimize painting costs while forming exact neighbor…
安排邮筒
Allocate k mailboxes to houses along a street minimizing total distance using dynamic programming with state transitions…
删掉一个元素以后全为 1 的最长子数组
Solve LeetCode 1493 by tracking runs of 1s around one deletion using a tight sliding window or state transition DP.
并行课程 II
Determine the minimum semesters to complete all courses with prerequisites using state transition dynamic programming an…
统计全 1 子矩形
Count Submatrices With All Ones is a dynamic programming problem focusing on submatrix counting using an efficient row-b…
石子游戏 IV
Stone Game IV requires predicting the winner using state transition dynamic programming with careful consideration of pe…
和为奇数的子数组数目
Count the number of subarrays with an odd sum using dynamic programming and prefix sum techniques.
字符串的好分割数目
Count all valid splits of a string where left and right substrings have equal distinct characters, using efficient state…
形成目标数组的子数组最少增加次数
The problem asks for the minimum number of operations to transform an initial array of zeros into a target array using s…
压缩字符串 II
Solve String Compression II with dynamic programming that tracks deletions, run boundaries, and digit-length jumps in co…
最大得分
Find the maximum possible score from two sorted arrays with a dynamic programming approach, leveraging partitioning and …
切棍子的最小成本
Find the minimum cost to cut a stick into segments at specified positions using dynamic programming and sorting.
吃掉 N 个橘子的最少天数
Find the minimum number of days to eat n oranges using state transition dynamic programming with memoization.
石子游戏 V
In Stone Game V, Alice divides stones into rows to maximize her score, using a dynamic programming approach to try all d…
乘积为正数的最长子数组长度
Given an array, find the maximum length of a subarray with a positive product using dynamic programming.
统计所有可行路径
This problem requires counting all possible routes between cities using fuel efficiently with state transition dynamic p…
使绳子变成彩色的最短时间
Minimize the time Bob needs to remove balloons to make a rope colorful using dynamic programming with state transitions.
矩阵的最大非负积
Find the maximum non-negative product path in a matrix using dynamic programming and state transition.
连通两组点的最小成本
Compute the minimum cost to fully connect two groups of points using dynamic programming and bitmasking efficiently.
使整数变为 0 的最少操作次数
Compute the minimum number of one-bit operations to convert a given integer to zero using state transition dynamic progr…
大小为 K 的不重叠线段的数目
Count all valid arrangements of k non-overlapping line segments on n points using state transition dynamic programming.
无矛盾的最佳球队
Find the highest score basketball team by choosing players without conflicts in age and score using dynamic programming.
统计只差一个字符的子串数目
Count all substrings from s that differ by exactly one character from some substring in t using precise substring compar…
通过给定词典构造目标字符串的方案数
Calculate the number of ways to form a target string using words of equal length via state transition dynamic programmin…
统计字典序元音字符串的数目
Calculate the number of length-n strings with vowels only that are sorted lexicographically using state transitions.
第 K 条最小指令
Find the kth smallest lexicographic instruction sequence for reaching a destination in a grid using state transition dyn…
使字符串平衡的最少删除次数
Determine the minimum number of deletions to transform a string of 'a' and 'b' into a balanced order using DP.
到家的最少跳跃次数
Find the minimum number of jumps needed to reach a target position while avoiding forbidden positions.
分配重复整数
Determine if you can allocate integers to satisfy customer quantities using state transition dynamic programming techniq…
最大化网格幸福感
Maximize Grid Happiness is a dynamic programming problem focusing on state transitions with bitmasking to maximize happi…
最大重复子字符串
Find the maximum number of times a given word repeats consecutively in a string using state transition dynamic programmi…
得到山形数组的最少删除次数
Solve the problem of finding the minimum number of removals to make a given array a mountain array using dynamic program…
最小不兼容性
Optimize the sum of incompatibilities when distributing an array into subsets with unique elements.
从仓库到码头运输箱子
Optimize the minimum number of trips to deliver boxes to ports under strict ship constraints using dynamic programming t…
石子游戏 VII
Maximize score difference in a two-player turn-based stone removal game using state transition dynamic programming.
堆叠长方体的最大高度
Maximize the height of stacked cuboids by strategically rotating and stacking them using dynamic programming.
跳跃游戏 VI
Jump Game VI challenges you to maximize your score while jumping through an array using state transition dynamic program…
完成所有工作的最短时间
Minimize the maximum working time of k workers by optimally assigning jobs, leveraging dynamic programming and bit manip…
生成乘积数组的方案数
Determine the number of arrays of size n where the product equals k using prime factorization and combinatorial DP techn…
分割回文串 IV
The Palindrome Partitioning IV problem asks you to determine if a string can be split into three palindromic substrings.
任意子数组和的绝对值的最大值
Solve for the maximum absolute sum of any subarray using dynamic programming and understanding state transitions.
最多可以参加的会议数目 II
Determine the maximum sum of event values you can collect by attending at most k non-overlapping events using DP.
最接近目标值的子序列和
Find the minimum absolute difference between a target goal and any subsequence sum using optimized dynamic programming a…
执行乘法运算的最大分数
Solve the Maximum Score from Performing Multiplication Operations problem using dynamic programming and state transition…
由子序列构造的最长回文串的长度
Maximize Palindrome Length From Subsequences explores dynamic programming to construct the longest palindrome from two s…
最接近目标价格的甜点成本
Find the closest dessert cost to a target by selecting from a list of base flavors and topping combinations using dynami…
使所有区间的异或结果为零
Determine the minimum changes needed in an array so all size-k segments XOR to zero using DP and bit manipulation.
N 次操作后的最大分数和
Maximize the score after n operations by selecting pairs from the array and using their GCD with dynamic programming or …
得到新鲜甜甜圈的最多组数
Reorder groups to maximize happy customers by using state transition dynamic programming with bitmasking for optimal bat…
最少侧跳次数
Solve the Minimum Sideway Jumps problem using state transition dynamic programming to minimize side jumps while navigati…
恰有 K 根木棍可以看到的排列数目
Calculate the number of arrangements of n uniquely-sized sticks so exactly k sticks are visible using dynamic programmin…
跳跃游戏 VII
The problem asks to determine if we can reach the last index of a binary string, with a set range of jumps between indic…
石子游戏 VIII
Stone Game VIII requires calculating maximum score difference using state transition dynamic programming on prefix sums …
两个数组最小的异或值之和
Minimize the XOR sum of two integer arrays by rearranging elements using dynamic programming and bit manipulation.
准时抵达会议现场的最小跳过休息次数
Solve the problem of minimizing skips while traveling to arrive on time, using dynamic programming and state transitions…
鸡蛋掉落-两枚鸡蛋
Determine the minimum drops needed to find the critical floor using 2 eggs with optimized state transition dynamic progr…
使二进制字符串字符交替的最少反转次数
Find the minimum number of flips to make a binary string alternate, using state transition dynamic programming.
反转表达式值的最少操作次数
Determine the minimum operations to change a boolean expression's result using state transition dynamic programming effi…
最佳运动员的比拼回合
This problem requires finding the earliest and latest rounds where two players compete using dynamic programming with st…
最大交替子序列和
Maximize alternating subsequence sum with dynamic programming and state transitions in an array.
规定时间内到达终点的最小花费
Minimize the travel cost in a graph while adhering to a time constraint using state transition dynamic programming.
用三种不同颜色为网格涂色
Count the number of ways to paint a grid using three colors while ensuring adjacent cells have different colors.
扣分后的最大得分
Maximize your points in a matrix by selecting cells row by row while accounting for distance penalties using dynamic pro…
最大兼容性评分和
Assign students to mentors to maximize total compatibility using state transition dynamic programming with bitmask optim…
统计特殊子序列的数目
Learn to count all valid special subsequences in an array using state transition dynamic programming efficiently and cor…
K 次调整数组大小浪费的最小总空间
Find the minimum total space wasted in a dynamic array with at most k resizing operations.
划分数字的方案数
Calculate the number of valid non-decreasing integer sequences from a string using state transition dynamic programming …
最小化目标值与所选元素的差
This problem asks to select one element per row to minimize the absolute difference from a target sum using dynamic prog…
完成任务的最少工作时间段
Find the minimum number of work sessions needed to finish a set of tasks, considering task durations and session time.
不同的好子序列数目
Find the number of unique good subsequences of a binary string using dynamic programming and modular arithmetic.
访问完所有房间的第一天
Calculate the first day you have visited all rooms using state transition dynamic programming on the nextVisit array.
两个回文子序列长度的最大乘积
Find two disjoint palindromic subsequences in a string to maximize the product of their lengths efficiently using dynami…
解出数学表达式的学生分数
Calculate student scores for a single-digit math expression using state transition dynamic programming to track all vali…
将数组分成两个数组并最小化数组和的差
Partition an integer array into two equal halves to minimize the absolute difference of their sums using dynamic program…
两个最好的不重叠活动
Maximize the total value of at most two non-overlapping events using state transition dynamic programming efficiently.
同源字符串检测
Determine if there exists an original string that could produce both encoded inputs using state transition dynamic progr…
所有子字符串中的元音
Compute the total number of vowels in all substrings of a given string using efficient state transition dynamic programm…
喂食仓鼠的最小食物桶数
Find the minimum number of food buckets required to feed all hamsters, using dynamic programming and greedy techniques.
统计农场中肥沃金字塔的数目
Solve Count Fertile Pyramids in a Land with matrix DP that measures the tallest pyramid rooted at each fertile cell.
适合野炊的日子
Find good days to rob the bank by identifying days with non-increasing and non-decreasing guard counts using dynamic pro…
股票平滑下跌阶段的数目
Count all contiguous periods where stock prices descend smoothly by exactly one using dynamic programming techniques.
解决智力问题
Maximize points in an exam with state transition dynamic programming by deciding whether to solve or skip each question.
分隔长廊的方案数
Calculate the number of ways to split a corridor into sections with exactly two seats using dynamic programming efficien…
删除元素后和的最小差值
Minimize the difference between sums after removing n elements from a 3n array by dividing the remaining elements into t…
移除所有载有违禁货物车厢所需的最少时间
Determine the minimum time to remove all cars with illegal goods using state transition dynamic programming efficiently.
数组的最大与和
Find the maximum AND sum by placing integers into limited slots using state transition dynamic programming efficiently.
完成比赛的最少时间
Minimize the time to complete a race with tire swaps using dynamic programming and state transitions.
用地毯覆盖后的最少白色砖块
Find the minimum number of white tiles visible after optimally placing carpets using state transition dynamic programmin…
从栈中取出 K 个硬币的最大面值和
Optimize coin selection across multiple piles using state transition dynamic programming to achieve the maximum wallet v…
选择建筑的方案数
Solve Number of Ways to Select Buildings by counting alternating 3-building patterns with state transitions over the bin…
字符串的总引力
Calculate the total appeal of all substrings by counting distinct characters efficiently using state transition DP and h…
统计打字方案数
Calculate the total number of possible original texts from a pressed key sequence using state transition dynamic program…
检查是否有合法括号字符串路径
Check if there exists a valid parentheses string path in a given grid using state transition dynamic programming.
最大波动的子字符串
Find the largest variance possible in any substring of a given string using dynamic programming.
网格中的最小路径代价
Minimize the cost of a path in a grid while considering move costs for each step.
公平分发饼干
The problem focuses on fairly distributing cookies among children to minimize the maximum unfairness of the distribution…
个位数字为 K 的整数之和
Determine the minimum set of positive integers whose units digits match k and sum exactly to num using DP patterns.
小于等于 K 的最长二进制子序列
Find the longest subsequence in a binary string that forms a number less than or equal to a given integer k.
卖木头块
Maximize your profit by cutting a wooden piece into smaller parts based on given prices and dimensions.
不同骰子序列的数目
Calculate the number of distinct sequences of dice rolls based on specific conditions using dynamic programming.
统计放置房子的方式数
This problem asks you to calculate the number of ways to place houses along a street while preventing adjacent houses on…
拼接数组的最大分数
Maximize the score of two arrays by splicing and swapping a subarray using dynamic programming.
知道秘密的人数
Calculate how many people know a secret over n days using state transition dynamic programming and careful simulation of…
统计理想数组的数目
This problem involves counting the number of ideal arrays of a given length under certain conditions using state transit…
检查数组是否存在有效划分
This problem challenges you to determine if an array can be partitioned into valid subarrays using dynamic programming.
最长理想子序列
The Longest Ideal Subsequence problem involves finding the longest subsequence where each character has a difference of …
统计特殊整数
Count the number of special integers in the interval [1, n] where digits of each integer are distinct.
二进制字符串重新安排顺序需要的时间
Calculate the exact seconds required to convert all 01 pairs into 10 in a binary string using state transitions.
恰好移动 k 步到达某一位置的方法数目
Find the number of ways to reach a position after exactly k steps on an infinite number line using dynamic programming.
最长递增子序列 II
Determine the longest increasing subsequence in an array where consecutive elements differ by at most k using dynamic pr…
找到所有好下标
Identify all indices in an array where the k-length prefix is non-increasing and the k-length suffix is non-decreasing.
对字母串可执行的最大删除数
Find the maximum number of deletions on a string using state transition dynamic programming and rolling hash techniques …
矩阵中和能被 K 整除的路径
Compute all paths in a matrix where the sum of elements is divisible by k using state transition dynamic programming eff…
最小化数组中的最大值
Minimize Maximum of Array involves finding the smallest possible maximum value after applying a series of operations on …
最小移动总距离
Optimize the total distance traveled by robots to factories using dynamic programming, sorting, and state transitions.
统计构造好字符串的方案数
Count the number of ways to build good binary strings using dynamic programming with state transitions.
不重叠回文子字符串的最大数目
Find the maximum number of non-overlapping palindromic substrings of at least length k in a string using dynamic program…
完美分割的方案数
The problem involves finding the number of beautiful partitions in a string with dynamic programming and state transitio…
统计回文子序列数目
Count the number of palindromic subsequences of length 5 in a given string of digits.
好分区的数目
Calculate the number of great partitions of an array using state transition dynamic programming with careful sum constra…
将字符串分割成值不超过 K 的子字符串
Determine the minimum number of substrings from a numeric string such that each substring value does not exceed k using …
统计上升四元组
Given a permutation of numbers, count the number of increasing quadruplets using dynamic programming.
二进制矩阵中翻转最多一次使路径不连通
Determine if a single cell flip can disconnect a path from the top-left to bottom-right in a binary matrix efficiently u…
打家劫舍 IV
House Robber IV requires calculating minimum maximum money the robber can take using state transition dynamic programmin…
将整数减少到零需要的最少操作数
Compute the minimum number of operations to reduce a positive integer to zero using additions or subtractions of powers …
无平方子集计数
Learn how to efficiently count square-free subsets using state transition dynamic programming with bitmask optimizations…
找出对应 LCP 矩阵的字符串
Determine the lexicographically smallest string matching a given LCP matrix using state transition dynamic programming.
获得分数的方法数
Find the number of ways to earn exactly target points using multiple types of exam questions with distinct marks.
最小化数对的最大差值
Minimize the Maximum Difference of Pairs seeks to optimize the maximum pairwise difference in a set of index pairs from …
网格图中最少访问的格子数
Determine the minimum number of cells to visit in a grid using state transition dynamic programming and efficient traver…
构造有效字符串的最少插入数
Determine the minimum insertions required to transform a given string into repeated concatenations of 'abc' using dynami…
英雄的力量
Calculate the total power of all non-empty hero groups using state transition dynamic programming efficiently with sorti…
矩阵中移动的最大次数
Maximize the number of moves in a grid starting from the first column using state transition dynamic programming.
一个小组的最大实力值
Maximize the strength of a student group by carefully selecting students based on their scores, using dynamic programmin…
使所有字符相等的最小成本
Find the minimum cost to make all characters of a binary string equal by performing two types of operations.
统计整数数目
Count of Integers challenges you to find the number of integers with a digit sum between a given range using dynamic pro…
特别的排列
Count the number of special permutations for a given array using dynamic programming and bit manipulation.
给墙壁刷油漆
Compute the minimum cost to paint all walls using a paid and free painter with state transition dynamic programming.
构造最长的新字符串
Maximize the length of a string built from AA, BB, and AB without creating triple repeats using DP and greedy logic.
字符串连接删减字母
Solve the Decremental String Concatenation problem by applying dynamic programming to minimize string length after conca…
将数组划分成若干好子数组的方式
Calculate the number of ways to partition a binary array into good subarrays using state transition dynamic programming …
将字符串分割为最少的美丽子字符串
Partition a binary string into the fewest beautiful substrings using state transition dynamic programming and careful su…
达到末尾下标所需的最大跳跃次数
Find the maximum number of jumps to reach the last index using state transition dynamic programming efficiently in array…
构造最长非递减子数组
Maximize the length of a non-decreasing subarray by optimally choosing elements from two arrays using dynamic programmin…
访问数组中的位置使分数最大
Maximize your score by visiting positions in an array while handling penalties for parity changes efficiently with DP.
将一个数字表示成幂的和的方案数
Compute the number of ways to express an integer as a sum of unique powers using state transition dynamic programming ef…
统计范围内的步进数字数目
Count the stepping numbers in a range using dynamic programming with state transitions between digits.
使数组和小于等于 x 的最少时间
Calculate the minimum seconds to reduce the array sum to at most x using optimal single-time reductions per index effici…
判断是否能拆分数组
Determine whether an array can be fully split into single-element subarrays using a state transition dynamic programming…
将三个组排序
Determine the minimum removals to make an array of 1s, 2s, and 3s non-decreasing using dynamic programming transitions.
范围中美丽整数的数目
Count all integers in a given range that have equal even and odd digits and are divisible by k using DP.
在传球游戏中最大化函数值
Maximize the total score in a ball-passing game by selecting the best starting player using state transition dynamic pro…
将石头分散到网格图的最少移动次数
Solve the problem of distributing 9 stones across a 3x3 grid with minimal moves using state transition dynamic programmi…
字符串转换
Find how many ways string s can be transformed into string t in exactly k operations using suffix rotations.
有向图访问计数
Count Visited Nodes in a Directed Graph uses dynamic programming to solve graph traversal and node visitation counting e…
执行操作使两个字符串相等
Apply Operations to Make Two Strings Equal involves transforming binary strings with a cost-based dynamic programming ap…
最长相邻不相等子序列 I
Find the longest alternating subsequence in a string array based on a binary group array.
最长相邻不相等子序列 II
Find the longest subsequence of indices such that the corresponding strings have a valid Hamming distance and group cons…
得到 K 个半回文串的最少修改次数
Minimize the number of letter changes to partition a string into k semi-palindromes using dynamic programming and two po…
和为目标值的最长子序列的长度
Find the length of the longest subsequence in an array that sums to a target value, using dynamic programming.
子数组不同元素数目的平方和 II
Compute the sum of squares of distinct elements in all subarrays using state transition dynamic programming efficiently.
使数组变美的最小增量运算数
Optimize the number of increment operations to make an array beautiful by ensuring subarrays of size 3 or more meet the …
平衡子序列的最大和
Learn to find the maximum sum of a balanced subsequence using dynamic programming and careful state transitions efficien…
重新排列后包含指定子字符串的字符串数目
Calculate how many strings of length n can be rearranged to contain "leet" using dynamic programming and combinatorics.
购买水果需要的最少金币数
Calculate the minimum coins to buy fruits using state transition dynamic programming while handling rewards and purchase…
找到最大非递减数组的长度
Solve Find Maximum Non-decreasing Array Length with prefix-sum DP transitions that maximize kept segments while preservi…
消除相邻近似相等字符
Minimize operations to remove adjacent almost-equal characters using dynamic programming and greedy methods.
转换字符串的最小成本 II
Compute the minimum cost to transform source into target using substring replacements with given costs efficiently using…
使 X 和 Y 相等的最少操作次数
Determine the minimum operations to make two integers equal using increment, decrement, and division efficiently with DP…
统计强大整数的数目
Count the number of powerful integers in a given range by applying state transition dynamic programming with constraints…
执行操作后的最大分割数量
Maximizing the number of partitions in a string after changing one character and applying partitioning operations using …
价值和小于等于 K 的最大数字
Find the greatest number whose accumulated price, based on binary set bit positions, is less than or equal to k.
相同分数的最大操作数目 II
This problem asks to maximize operations on an integer array where all deletions produce the same score using dynamic pr…
修改数组后最大化数组中的连续元素数目
Solve Maximize Consecutive Elements in an Array After Modification by sorting and using state transition DP on value and…
K 个不相交子数组的最大能量值
Solve Maximum Strength of K Disjoint Subarrays with dynamic programming that tracks segment state, sign changes, and wei…
求出所有子序列的能量和
Find the sum of the power of all subsequences of an integer array where their sum equals a given number.
求出所有子序列的能量和
Compute the sum of powers for all subsequences of length k using state transition dynamic programming efficiently.
划分数组得到最小的值之和
Solve the problem of dividing an array into subarrays to match specified bitwise AND values using dynamic programming.
使矩阵满足条件的最少操作次数
This problem asks to find the minimum number of operations on a 2D grid using state transition dynamic programming effic…
找出所有稳定的二进制数组 I
Find all stable binary arrays of a given number of 0's, 1's, and limit using dynamic programming and state transitions.
找出所有稳定的二进制数组 II
Compute the number of stable binary arrays using state transition dynamic programming with exact zero, one, and limit co…
分割字符频率相等的最少子字符串
Partition a string into substrings with equal character frequencies using dynamic programming and state transitions.
矩阵中的最大得分
Maximize the score in a grid by making moves to the bottom or right, using state transition dynamic programming.
找出分数最低的排列
Determine the lexicographically smallest permutation of nums that minimizes a cyclic score using state transition DP tec…
到达第 K 级台阶的方案数
Determine the total number of ways to reach the k-th stair using a state transition dynamic programming approach with co…
不包含相邻元素的子序列的最大和
Compute the maximum sum of a subsequence where no two adjacent elements are selected after each array update efficiently…
执行操作可获得的最大总奖励 I
Optimize the total reward by choosing operations on array indices using state transition dynamic programming techniques …
执行操作可获得的最大总奖励 II
Maximize your total reward using dynamic programming with state transitions in this challenging problem involving array …
使二进制数组全部等于 1 的最少操作次数 II
Solve the Minimum Operations to Make Binary Array Elements Equal to One II using state transition dynamic programming ef…
统计逆序对的数目
Count the number of valid permutations satisfying inversion constraints using state transition dynamic programming.
最大化子数组的总成本
Maximize the total cost of alternating subarrays using dynamic programming to efficiently split an array into optimal su…
找出有效子序列的最大长度 I
Find the longest valid subsequence in an array of integers using dynamic programming to handle different patterns of seq…
找出有效子序列的最大长度 II
Determine the maximum length of a valid subsequence using state transition dynamic programming with careful modulo const…
最小代价构造字符串
This problem asks you to construct a target string using given words at minimal cost using dynamic programming technique…
切蛋糕的最小总开销 I
In this problem, you need to minimize the cost of cutting a cake into 1x1 pieces using vertical and horizontal cuts.
网格图操作后的最大分数
Maximize your score by choosing the optimal sequence of column operations on a grid using dynamic programming transition…
使数组等于目标数组所需的最少操作次数
This problem requires calculating the minimum number of operations to transform one array into another using state trans…
单调数组对的数目 I
Compute the number of monotonic pairs in an integer array using state transition dynamic programming efficiently.
单调数组对的数目 II
This problem involves finding the count of monotonic pairs in an array using dynamic programming and combinatorics techn…
放三个车的价值之和最大 I
Maximize the value sum by placing three rooks on a chessboard while ensuring they do not attack each other.
放三个车的价值之和最大 II
Maximize the sum by placing three non-attacking rooks on a chessboard with dynamic programming.
超级饮料的最大强化能量
Maximize energy boost from two drinks with a state transition dynamic programming approach.
找出最大的 N 位 K 回文数
Compute the largest n-digit integer divisible by k that forms a palindrome using state transition dynamic programming te…
选择矩阵中单元格的最大得分
Optimize selection of grid cells using state transition dynamic programming to maximize total sum efficiently.
查询子数组最大异或值
Solve the Maximum XOR Score Subarray Queries problem using state transition dynamic programming for optimal subarray com…
求出数组中最大序列值
Determine the maximum value of a subsequence in an integer array using state transition dynamic programming and bit oper…
最高乘法得分
The problem requires selecting four indices from an array to maximize a dynamic score with a transition approach.
形成目标字符串需要的最少字符串数 I
Use dynamic programming to split target into the fewest prefixes that match any word prefix, while ruling out dead posit…
形成目标字符串需要的最少字符串数 II
Compute the minimum number of valid strings from an array needed to construct a given target string efficiently using dy…
字典序最小的合法序列
Determine the lexicographically smallest valid index sequence by using state transition dynamic programming over word1 a…
安排活动的方案数
Given n performers, x stages, and y scores, calculate the number of possible ways to assign performers and score bands.
统计能获胜的出招序列数
Count The Number of Winning Sequences is a dynamic programming challenge involving state transitions based on Alice’s cr…
旅客可以得到的最多点数
Calculate the maximum points a tourist can earn by choosing optimal city moves over k days using state transition DP.
找到初始输入字符串 II
Calculate how many potential original strings Alice might have intended to type, considering her clumsy typing behavior.
字符串转换后的长度 I
Calculate the total number of characters in a string after repeated transformations using dynamic programming and freque…
最大公约数相等的子序列数量
Count all pairs of non-empty subsequences in an integer array whose elements share the same greatest common divisor effi…
字符串转换后的长度 II
Calculate the length of a string after repeated transformations using state transition dynamic programming for large t v…
统计平衡排列的数目
Determine how many distinct permutations of a digit string are balanced using state transition dynamic programming effic…
统计小于 N 的 K 可约简整数
This problem challenges you to count the K-reducible numbers less than a given binary integer using dynamic programming.
最多可收集的水果数目
Maximize the number of fruits collected by three children navigating a grid dungeon with dynamic programming.
最小数组和
Solve the Minimum Array Sum problem using dynamic programming by tracking states and operations to minimize the sum of a…
破解锁的最少时间 I
Solve the Minimum Time to Break Locks I problem using state transition dynamic programming to minimize the time to break…
统计数组中的美丽分割
Learn to count all valid beautiful splits in an array using state transition dynamic programming efficiently and accurat…
使字符频率相等的最少操作次数
This Hard problem asks to transform a string so all character frequencies match using minimal deletions, leveraging dyna…
统计异或值为给定值的路径数目
Count the number of paths in a grid where the XOR of all values along the path equals a given number.
最长相邻绝对差递减子序列
Find the length of the longest subsequence with non-increasing absolute adjacent differences.
删除所有值为某个元素后的最大子数组和
Maximize Subarray Sum After Removing All Occurrences of One Element involves finding the optimal subarray sum with one a…
不重叠区间的最大得分
Maximize the score of up to 4 non-overlapping intervals, considering their weight and ensuring no overlap between chosen…
机器人可以获得的最大金币数
Find the maximum amount of money a robot can collect while neutralizing robbers on its path in a grid.
最多 K 个元素的子序列的最值之和
Find the sum of the maximum and minimum elements of subsequences with at most k elements, using dynamic programming.
粉刷房子 IV
Solve the Paint House IV problem using state transition dynamic programming to minimize the painting costs while adherin…
变成好标题的最少代价
Solve Minimum Cost Good Caption with dynamic programming that builds minimum edit cost while enforcing character runs of…
使数组包含目标值倍数的最少增量
This problem involves incrementing elements of an array to make sure each target element has at least one multiple in th…
统计可以被最后一个数位整除的子字符串数目
Count the number of substrings in a string divisible by their last non-zero digit using dynamic programming.
选择 K 个互不重叠的特殊子字符串
Determine if k non-overlapping special substrings exist in a string using dynamic programming and careful substring trac…
最长 V 形对角线段的长度
Compute the maximum length of a V-shaped diagonal segment in a 2D integer matrix using state transition dynamic programm…
移除所有数组元素的最小代价
Find the minimum cost to remove all elements from the array with dynamic programming.
至多 K 次操作后的最长回文子序列
Find the longest palindromic subsequence of a string after performing at most k operations to adjust letters.
长度至少为 M 的 K 个子数组之和
Maximize the sum of k non-overlapping subarrays of at least length m using dynamic programming and prefix sums efficient…
统计美丽整数的数目
Count Beautiful Numbers using state transition dynamic programming to efficiently calculate valid numbers in a given ran…
将数组分割为子数组的最小代价
Optimize array splits with dynamic programming to minimize costs for the Minimum Cost to Divide Array Into Subarrays pro…
子字符串连接后的最长回文串 I
Compute the maximum palindrome length by concatenating substrings from two strings using state transition dynamic progra…
子字符串连接后的最长回文串 II
Compute the longest palindrome by concatenating substrings from two strings using state transition dynamic programming e…
统计逐位非递减的整数
Count all integers between l and r whose digits never decrease in base b using state transition dynamic programming effi…
求出数组的 X 值 I
Determine the x-value of an array using state transition dynamic programming to count valid prefix-suffix operations eff…
判断连接可整除性
Find the lexicographically smallest permutation of numbers whose concatenation is divisible by k using state transition …
合并得到最小旅行时间
Minimize the total travel time by merging road signs, using dynamic programming to manage state transitions efficiently.
魔法序列的数组乘积之和
Use state transition dynamic programming to count magical index sequences and accumulate weighted products without enume…
K 条边路径的最大边权和
Determine the maximum sum of edge weights for a k-edge path in a DAG using state transition dynamic programming efficien…
不相交子字符串的最大数量
Determine the maximum number of non-overlapping substrings in a word, each at least four characters and matching start-e…
移除相邻字符后字典序最小的字符串
Find the lexicographically smallest string by repeatedly removing adjacent characters optimally using dynamic programmin…
买卖股票的最佳时机 V
Maximize profit from stock trades with at most k transactions using state transition dynamic programming for precise dec…
统计极差最大为 K 的分割方式数
Count the number of valid ways to partition an array into contiguous segments where max-min difference is at most k.
字符串转换需要的最小操作数
Transform word1 into word2 using minimal operations on substrings with a dynamic programming state transition approach.
硬币面值还原
Recover coin denominations from a numWays array using state transition dynamic programming to reconstruct valid sets eff…
所有人渡河所需的最短时间
Find the minimum time to transport individuals across a river with dynamic environmental conditions and boat capacity.
划分数组得到最小 XOR
Partition an integer array into k subarrays to minimize the maximum XOR using state transition dynamic programming effic…
交替方向的最小路径代价 II
This problem focuses on finding the minimum cost path with alternating directions in a grid using dynamic programming.
图中的最长回文路径
Find the longest path in a graph that forms a palindrome using state transition dynamic programming and bitmask techniqu…
位计数深度为 K 的整数数目 I
Calculate the number of integers in a given range with a specific popcount-depth using state transition dynamic programm…