面试场景
高频考察问题建模、边界条件与口头表达的清晰度。
常见误区
只背模板不解释为什么,容易在追问里失分。
练习策略
每轮练 3-5 题,固定复盘复杂度和可替代解法。
推荐练习顺序
无重复字符的最长子串
Find the length of the longest substring without repeating characters using a sliding window and hash map to track state…
最长回文子串
Find the longest contiguous palindromic substring in a given string using dynamic programming and two-pointer expansion …
Z 字形变换
Convert a string into a zigzag pattern across multiple rows and read it line by line efficiently for string manipulation…
字符串转换整数 (atoi)
Convert a string to a 32-bit signed integer by carefully parsing characters, handling signs, and ignoring invalid traili…
正则表达式匹配
The Regular Expression Matching problem involves checking if a string matches a pattern using '.' and '*'.
整数转罗马数字
Convert a given integer to its Roman numeral representation using hash table mapping and decimal place math operations e…
罗马数字转整数
Convert a Roman numeral string into an integer using a hash table and mathematical principles to determine value order.
最长公共前缀
Find the longest common prefix in an array of strings, returning an empty string if none exists.
电话号码的字母组合
Generate all letter combinations a digit string can represent using backtracking with pruning, leveraging hash table map…
有效的括号
Determine if a string of parentheses, brackets, and braces is correctly nested using a stack for proper order validation…
括号生成
Generate Parentheses requires generating all valid combinations of parentheses with given pairs using backtracking and s…
找出字符串中第一个匹配项的下标
Locate the first occurrence of a substring within a string using a two-pointer scanning strategy and invariant tracking …
串联所有单词的子串
Find all starting indices of substrings in a string that are concatenations of a given list of words.
最长有效括号
Compute the length of the longest well-formed parentheses substring using state transition dynamic programming and stack…
外观数列
Count and Say requires building the nth sequence term by iteratively applying a run-length encoding on strings of digits…
字符串相乘
Multiply Strings requires simulating integer multiplication using only string operations without direct numeric conversi…
通配符匹配
Implement full wildcard pattern matching using '?' and '*' by applying state transition dynamic programming with careful…
字母异位词分组
Group the anagrams in a list of strings using efficient hash table-based methods, focusing on array scanning.
最后一个单词的长度
Determine the length of the last word in a string using a focused string-driven approach to handle spaces and trailing c…
有效数字
Determine if a given string represents a valid number using precise string parsing and character validation rules.
二进制求和
Add Binary involves summing two binary strings and returning the result as a binary string using math and string manipul…
文本左右对齐
Text Justification requires packing words into lines to match a specified width, ensuring even distribution of spaces.
简化路径
Simplify a Unix-style path by transforming it into its canonical form using stack-based state management.
编辑距离
Determine the minimum number of insertions, deletions, or replacements to transform one string into another using dynami…
最小覆盖子串
Find the smallest substring of s containing all characters from t using a sliding window with running state updates for …
单词搜索
Solve Word Search with backtracking by exploring adjacent cells to match a target word in a grid.
扰乱字符串
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.
复原 IP 地址
Restore all valid IP addresses from a string using backtracking with pruning, avoiding invalid segments or leading zeros…
交错字符串
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…
验证回文串
Check if a given string is a valid palindrome by using two-pointer scanning and invariant tracking techniques.
单词接龙 II
Find all shortest transformation sequences from beginWord to endWord using a dictionary, leveraging backtracking search …
单词接龙
Find the shortest transformation sequence from a start word to an end word, with each word in the sequence differing by …
分割回文串
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…
单词拆分
Determine if a string can be fully segmented into dictionary words using array scanning and hash-based lookups for effic…
单词拆分 II
Given a string and dictionary, return all possible sentences by adding spaces where each word is in the dictionary.
反转字符串中的单词
Reverse Words in a String requires reordering words using precise two-pointer scanning with careful space handling for e…
比较版本号
Compare two version numbers by checking their individual revisions, considering missing revisions as zero, using a two-p…
分数到小数
Convert a fraction into a decimal, handling repeating decimals with parentheses around the repeating part.
Excel 表列名称
Convert a positive integer to its corresponding Excel column title using base-26 math and string manipulation efficientl…
Excel 表列序号
This problem requires converting an Excel column title into its corresponding column number by applying a math and strin…
最大数
The problem asks to arrange integers to form the largest possible number, focusing on greedy algorithms and string handl…
重复的DNA序列
Solve Repeated DNA Sequences by sliding a length-10 window and tracking seen patterns with a hash set or bitmask.
同构字符串
Determine if two strings are isomorphic by checking if one string can be transformed into the other using character repl…
实现 Trie (前缀树)
This problem requires designing a Trie (Prefix Tree) to efficiently store and query strings using hash table concepts fo…
添加与搜索单词 - 数据结构设计
Build a WordDictionary supporting dynamic word addition and search with wildcard matching efficiently using Trie and DFS…
单词搜索 II
Solve the Word Search II problem using backtracking with pruning to find all words on a board of characters.
最短回文串
The Shortest Palindrome problem asks to transform a string into a palindrome by adding characters at the beginning, with…
基本计算器
Implement a basic calculator to evaluate mathematical expressions, ensuring correct evaluation with stack-based manageme…
基本计算器 II
Basic Calculator II evaluates a mathematical expression with operators and integers, handling basic arithmetic with prec…
为运算表达式设计优先级
Solve Different Ways to Add Parentheses by splitting on each operator and memoizing every subexpression result list.
有效的字母异位词
Check if two strings are anagrams using hashing or sorting techniques.
二叉树的所有路径
Find all root-to-leaf paths in a binary tree using DFS and backtracking, constructing strings for each complete path eff…
整数转换英文表示
Convert a given integer to its English words representation using mathematical logic and string manipulation.
给表达式添加运算符
Expression Add Operators is solved with backtracking that builds multi-digit operands and tracks multiplication preceden…
单词规律
Solve Word Pattern by checking a one-to-one mapping between pattern letters and words using hash tables after splitting …
二叉树的序列化与反序列化
This problem asks to serialize and deserialize a binary tree, requiring an efficient approach to handle traversal and st…
猜数字游戏
Solve the Bulls and Cows problem using hash tables and string manipulation to track exact and misplaced digits.
删除无效的括号
Remove the minimum number of invalid parentheses to generate all possible valid strings efficiently using backtracking a…
累加数
Additive Number is solved by trying the first two splits, then pruning aggressively while verifying each required sum in…
去除重复字母
Remove duplicate letters from a string to produce the lexicographically smallest result using stack-based state manageme…
最大单词长度乘积
The problem requires finding the maximum product of lengths of two words from an array, where the words don't share comm…
验证二叉树的前序序列化
Determine if a given string correctly represents a binary tree preorder traversal using state tracking and slot counting…
回文对
Find all pairs of words in a list that form palindromes when concatenated using efficient scanning and hash mapping.
反转字符串
Reverse a character array in-place using a two-pointer scanning technique, ensuring minimal memory and correct index swa…
反转字符串中的元音字母
Reverse Vowels of a String uses a two-pointer approach to reverse the vowels in a string while leaving the consonants in…
赎金信
Determine if a ransom note can be constructed from a magazine's letters using hash tables and string counting techniques…
迷你语法分析器
Deserialize a nested list string using stack-based state management, handling integers and nested lists with depth-first…
字符串中的第一个唯一字符
Find the index of the first non-repeating character in a string using efficient queue-driven state processing.
文件的最长绝对路径
Find the length of the longest absolute file path in a filesystem string using stack-based depth tracking efficiently.
找不同
Find the Difference involves identifying the additional letter in one string compared to another, emphasizing hash table…
判断子序列
Determine if one string is a subsequence of another using state transition dynamic programming for accurate character ma…
字符串解码
Decode a nested encoded string using stack-based state management, handling repeated patterns efficiently with recursion…
至少有 K 个重复字符的最长子串
Find the length of the longest substring where every character appears at least k times using sliding window and divide-…
除法求值
Compute the results of division queries from given equations using graph traversal and depth-first search efficiently.
移掉 K 位数字
Remove K Digits requires selecting which digits to drop using a monotonic stack for the smallest possible integer result…
数字转换为十六进制数
Convert a 32-bit integer to its hexadecimal string using math operations and careful string manipulation techniques.
最长回文串
Determine the length of the longest palindrome constructible from a given string using greedy counting and frequency tra…
Fizz Buzz
Generate a list from 1 to n replacing multiples of 3 with Fizz, 5 with Buzz, and both with FizzBuzz efficiently.
字符串相加
Given two non-negative integers as strings, sum them and return the result as a string without converting to integers di…
强密码检验器
The Strong Password Checker problem challenges you to optimize password strength while minimizing steps using greedy alg…
从英文中重建数字
This problem asks you to reconstruct digits from an out-of-order English string using hash counting and mathematical ded…
替换后的最长重复字符
Find the length of the longest substring after at most k replacements using a sliding window and character count trackin…
最小基因变化
Determine the minimum number of single-character gene mutations to reach the target gene using BFS and a hash table look…
字符串中的单词数
Count the segments of non-space characters in a string by applying a string-driven approach to solve the problem.
找到字符串中所有字母异位词
Find all starting indices of p's anagrams in s using sliding window and hash table approach.
压缩字符串
Compress a character array in-place by converting consecutive repeated characters into counts using two-pointer scanning…
序列化和反序列化二叉搜索树
Design an algorithm to serialize and deserialize a binary search tree with efficient traversal and state tracking.
根据字符出现频率排序
Sort Characters By Frequency requires counting characters efficiently and rearranging a string in descending frequency o…
重复的子字符串
Check if a string can be constructed by repeating a substring using string matching techniques.
统计重复个数
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.
验证IP地址
Determine whether a given string is a valid IPv4 or IPv6 address using a precise string-driven validation strategy.
连接词
Find concatenated words by using dynamic programming and depth-first search to identify valid words made of other words …
一和零
Solve the Ones and Zeroes problem using dynamic programming with state transition, focusing on array and string manipula…
神奇字符串
Count the number of '1's in the first n characters of a magical string using two-pointer scanning and invariant tracking…
密钥格式化
Reformat a license key string by splitting into groups of size k, converting to uppercase, and handling dashes appropria…
祖玛游戏
The Zuma Game involves clearing balls from the board using a limited hand, applying dynamic programming and state transi…
键盘行
Identify all words from a list that can be typed using letters from only one row of a standard American keyboard.
七进制数
Convert any given integer to its base 7 string representation using efficient math and string manipulation techniques.
自由之路
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.
检测大写字母
Detect Capital asks you to determine if a word follows a correct capital usage pattern based on specific rules.
最长特殊序列 Ⅰ
Determine the length of the longest uncommon subsequence between two strings using a direct string comparison strategy.
最长特殊序列 II
Find the longest string in an array that is not a subsequence of any other string, using array scanning and hash checks …
通过删除字母匹配到字典里最长单词
Find the longest word in the dictionary that can be formed by deleting characters from a string, using two-pointer scann…
TinyURL 的加密与解密
Design a class that encodes and decodes URLs using a URL shortening approach based on hash tables and strings.
复数乘法
This problem requires multiplying two complex numbers, given in string form, and returning the result in the same format…
最小时间差
Calculate the smallest time difference between clock points using array manipulation and mathematical conversions effici…
反转字符串 II
Reverse String II requires reversing segments of a string using two-pointer scanning while tracking invariants carefully…
学生出勤记录 I
Determine if a student's attendance record qualifies for an award based on specific criteria for absences and lateness.
下一个更大元素 III
Find the next greater integer using the same digits as a given number with precise two-pointer scanning and invariant tr…
反转字符串中的单词 III
Reverse Words in a String III involves reversing each word in a sentence using the two-pointer technique.
寻找最近的回文数
Identify the nearest palindrome to a given integer string, handling ties and large numbers efficiently using math and st…
字符串的排列
Check if a string contains a permutation of another string using two-pointer scanning and hash table techniques.
两个字符串的删除操作
Find the minimum number of steps to make two strings equal by deleting characters, using dynamic programming.
标签验证器
The Tag Validator problem involves validating a code snippet by parsing through tags using a stack-based state managemen…
分数加减运算
Solve fraction addition and subtraction by handling expressions, calculating results, and simplifying fractions to irred…
两个列表的最小索引总和
Find the common strings between two lists with the smallest index sum in this easy problem involving array scanning and …
根据二叉树创建字符串
Given a binary tree, construct a string representation based on preorder traversal while adhering to specific formatting…
在系统中查找重复文件
Find and return duplicate files in the file system, grouping them by their paths and contents using an array scanning ap…
解码方法 II
Decode Ways II is a challenging dynamic programming problem that involves decoding messages with digits and wildcard cha…
求解方程
Solve the equation for the variable 'x' and determine its value or state if there is no solution or infinite solutions.
回文子串
Count all palindromic substrings in a given string using state transition dynamic programming for efficient evaluation.
单词替换
Replace words in a sentence using the shortest root from a dictionary, applying efficient array scanning and hash lookup…
Dota2 参议院
The Dota2 Senate problem involves simulating voting rounds between Radiant and Dire senators until one party wins, using…
机器人能否返回原点
Judge whether a robot returns to the origin after a sequence of moves using string manipulation and simulation.
奇怪的打印机
Calculate the minimum turns a strange printer needs to print any string using state transition dynamic programming effic…
实现一个魔法字典
Design a Magic Dictionary to allow searching with one-character modifications, using Hash Table and String techniques.
键值映射
Design and implement a data structure that supports efficient insertion and sum queries based on string prefixes.
有效的括号字符串
Solve the Valid Parenthesis String problem by leveraging state transition dynamic programming to handle parentheses and …
验证回文串 II
Check if a string can become a palindrome by deleting at most one character using two-pointer scanning and invariant tra…
重复叠加字符串匹配
Find the minimum number of repetitions of string a to make string b a substring of the repeated string a.
贴纸拼词
Determine the minimum number of stickers needed to spell a target word using array scanning and hash lookups for efficie…
前K个高频单词
Solve Top K Frequent Words by counting each word, then ordering ties alphabetically so frequency wins before lexicograph…
计数二进制子串
Count Binary Substrings solves for the number of valid substrings with equal 0's and 1's, grouped consecutively in a bin…
转换成小写字母
The "To Lower Case" problem asks you to convert all uppercase letters in a string to lowercase.
两个字符串的最小ASCII删除和
This problem focuses on minimizing the ASCII delete sum for two strings by using dynamic programming to find the lowest …
词典中最长的单词
Find the longest word in a dictionary that can be built one character at a time from other words in the dictionary.
账户合并
Merge accounts by connecting emails and returning each user's sorted email list using array scanning and hash lookup eff…
删除注释
Remove comments from a given C++ program source array, handling line and block comments.
原子的数量
Compute the exact count of each atom in a chemical formula using stack-based state management and hashing techniques eff…
统计不同回文子序列
Count Different Palindromic Subsequences leverages dynamic programming to count non-empty palindromic subsequences in a …
Lisp 语法解析
Parse Lisp expressions using stack-based state management to evaluate variables and operations.
前缀和后缀搜索
Design a dictionary to search words by both prefix and suffix using a Trie structure and hash lookups.
最短补全词
Find the shortest word that completes the license plate by matching all required letters, considering frequency and case…
打开转盘锁
Solve the Open the Lock problem using array scanning plus hash lookup to efficiently find the shortest unlock sequence.
特殊的二进制字符串
Solve the Special Binary String problem using string manipulation and recursion, optimizing lexicographical order.
划分字母区间
Partition a string into maximal parts so that each letter appears in only one segment, using two-pointer scanning.
重构字符串
Reorganize a string so that no two adjacent characters are the same, if possible, using a greedy approach.
基本计算器 IV
Simplify mathematical expressions using stack-based state management, handling variables, operators, and polynomial term…
宝石与石头
Given two strings, determine how many of the stones you have are also jewels, considering case sensitivity.
在 LR 字符串中交换相邻字符
Transform one string into another by swapping adjacent 'L' and 'R' characters in a sequence of moves.
字母大小写全排列
Letter Case Permutation involves generating all possible strings by changing the case of each letter in a given string.
自定义字符串排序
Sort the string `s` according to a custom order defined by string `order`.
匹配子序列的单词数
Given a string s and a list of words, count how many words are subsequences of s using efficient array scanning and hash…
旋转字符串
Determine if one string can be rotated into another by repeatedly shifting characters, leveraging string matching techni…
唯一摩尔斯密码词
Determine how many unique Morse code transformations can be generated from a list of words using a hash table and array …
写字符串需要的行数
Calculate how many lines are needed to write a string given individual letter widths, constrained to 100 pixels per line…
情感丰富的文字
Expressive Words challenges you to determine if a word can be transformed into a given string by extending groups of rep…
子域名访问计数
The Subdomain Visit Count problem requires counting the visits to all subdomains of a given domain from a list of count-…
模糊坐标
Find all valid 2D coordinate possibilities for an ambiguous input string using backtracking and pruning techniques.
最常见的单词
Find the most frequent non-banned word in a paragraph, excluding punctuation, using an efficient array scan and hash tab…
单词的压缩编码
Find the minimum length of a reference string encoding an array of words using array scanning and hash lookup efficientl…
字符的最短距离
Compute the minimum distance from each character in a string to a target character using efficient scanning techniques.
山羊拉丁文
Convert a sentence to Goat Latin by transforming each word based on vowel rules and incremental suffixes efficiently.
统计子串中的唯一字符
Calculate the sum of unique characters in all substrings of a string using state transition dynamic programming.
较大分组的位置
Identify and return intervals of consecutive, large character groups in a string of lowercase letters.
隐藏个人信息
This problem requires masking sensitive parts of emails and phone numbers using a precise string-driven strategy efficie…
字符串中的查找与替换
This problem challenges you to perform multiple string replacements at specific indices using a pattern involving array …
推多米诺
In the "Push Dominoes" problem, you simulate the falling dominoes based on their initial states and determine their fina…
相似字符串组
Determine the number of connected groups of similar strings by swapping at most two letters using array scanning and has…
将数组拆分成斐波那契序列
This problem challenges you to split a string into a Fibonacci-like sequence using backtracking and pruning.
猜猜这个单词
Master the Guess the Word problem by applying array manipulation, match-counting math, and strategic interactive guessin…
比较含退格的字符串
Compare two strings after processing backspaces using efficient two-pointer scanning and careful invariant tracking to e…
字母移位
Given a string and a shift array, shift the first i+1 letters of the string as specified in the array.
相似度为 K 的字符串
K-Similar Strings involves finding the minimal number of swaps to transform one string into another through character sw…
括号的分数
Calculate the score of a balanced parentheses string using stack-based state management for an optimal solution.
亲密字符串
Determine if two strings can become equal by swapping exactly two letters using a hash table for character tracking.
索引处的解码字符串
Decode the string and find the k-th letter efficiently using stack-based state management in this problem.
两句话中的不常见单词
Find uncommon words from two sentences by counting word frequencies using hash tables.
查找和替换模式
Identify all words matching a given pattern by checking consistent letter mappings using hash tables and array scanning …
特殊等价字符串组
Determine the number of special-equivalent string groups using character swaps at even or odd indices efficiently.
有序队列
Given a string and integer k, rearrange characters to achieve the lexicographically smallest string using limited rotati…
最大为 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…
超级回文数
Count all super-palindromes in a given numeric range, where each is a palindrome and square of a palindrome.
单词子集
Word Subsets is solved by merging words2 into one max-frequency requirement, then scanning words1 against that fixed let…
仅仅反转字母
Reverse the characters of a string while skipping non-letter characters using a two-pointer technique.
使括号有效的最少添加
Compute the minimum insertions needed to make a parentheses string valid using efficient stack-based state tracking tech…
长按键入
Check if a typed string could result from long pressing characters while typing a given name using a two-pointer scan.
将字符串翻转到单调递增
Minimize the number of flips needed to make a binary string monotone increasing using dynamic programming.
独特的电子邮件地址
Identify the count of unique email addresses by normalizing local names and using hash-based lookups efficiently.
戳印序列
Solve Stamping The Sequence with stack-based state management to convert string s to target using stamp efficiently.
重新排列日志文件
Reorder Data in Log Files requires sorting letter-logs lexicographically while keeping digit-logs in original order for …
不同的子序列 II
Find the number of distinct non-empty subsequences of a string using dynamic programming and state transitions.
增减字符串匹配
Reconstruct a permutation from a DI string using two-pointer scanning, carefully tracking the increasing and decreasing …
最短超级串
This problem requires constructing the shortest string containing all input words using state transition dynamic program…
删列造序
The 'Delete Columns to Make Sorted' problem asks to remove unsorted columns from a string array, ensuring all columns ar…
给定数字能组成的最大时间
Given four digits, determine the latest valid 24-hour time possible using each digit exactly once with backtracking.
验证外星语词典
Verify if a sequence of words is sorted according to an alien language's custom alphabet order using array scanning and …
删列造序 II
Solve the "Delete Columns to Make Sorted II" problem by applying greedy choices and invariant validation to string array…
删列造序 III
The problem requires minimizing deletions to ensure all strings are lexicographically sorted. Use dynamic programming fo…
元音拼写检查器
Implement a spellchecker that matches queries to a wordlist using exact, case-insensitive, and vowel-error rules efficie…
相等的有理数
Given two rational numbers as strings with possible repeating decimals, determine if they represent the same number.
基于时间的键值存储
Implement a time-based key-value store that retrieves the latest value at a given timestamp using efficient binary searc…
不含 AAA 或 BBB 的字符串
Solve the problem of constructing a string without consecutive 'AAA' or 'BBB' by applying a greedy approach with invaria…
从叶结点开始的最小字符串
Determine the lexicographically smallest string from a leaf to root using binary-tree traversal and careful state tracki…
等式方程的可满足性
Determine if it's possible to assign values to variables such that all equations are satisfied based on equality and ine…
查找共用字符
Return an array of common characters from all strings in the given list of words, including duplicates.
检查替换后的词是否有效
Determine if a string can be built from repeated 'abc' insertions using stack-based state management, verifying sequence…
子串能表示从 1 到 N 数字的二进制串
Check if binary string contains all integers from 1 to n as substrings, leveraging sliding window and bit manipulation t…
删除最外层的括号
Remove Outermost Parentheses simplifies a valid parentheses string by removing the outermost layers of parentheses in ea…
驼峰式匹配
Camelcase Matching is a medium difficulty problem where you match queries to a given pattern by inserting lowercase lett…
从先序遍历还原二叉树
Recover a binary tree from its preorder traversal string by tracking node depth and reconstructing child relationships e…
字符流
Implement a StreamChecker that detects if any suffix of a character stream matches a given list of words using efficient…
困于环中的机器人
Determine if a robot following a repeated instruction sequence stays within a bounded circle using math and string simul…
最长重复子串
Find the longest duplicated substring in a string using binary search, sliding window, and rolling hash techniques.
删除字符串中的所有相邻重复项
Solve Remove All Adjacent Duplicates In String by simulating deletions with a stack that collapses matching neighbors im…
最长字符串链
Find the longest word chain by scanning arrays and using hash lookups to efficiently track predecessor-successor sequenc…
按字典序排列最小的等效字符串
Determine the lexicographically smallest string by modeling character equivalences with union find efficiently.
字符串的最大公因子
Find the greatest common divisor string between two strings based on the math and string patterns.
Bigram 分词
Extract the third word in every adjacent triple of words matching a given bigram pattern from a text.
活字印刷
Compute all unique non-empty sequences from given letter tiles using backtracking search with pruning efficiently.
不同字符的最小子序列
The Smallest Subsequence of Distinct Characters problem asks you to find the lexicographically smallest subsequence of a…
最短公共超序列
Compute the shortest string containing both given strings as subsequences using state transition dynamic programming eff…
花括号展开 II
Solve Brace Expansion II efficiently by using stack-based state management to generate all unique combinations of nested…
解析布尔表达式
Solve the "Parsing A Boolean Expression" problem by evaluating boolean expressions using stack-based state management, r…
IP 地址无效化
Transform an IPv4 address by replacing each period with '[.]', focusing on a string-driven, direct manipulation approach…
有效括号的嵌套深度
This problem challenges you to compute the maximum nesting depth of two valid parentheses strings using stack-based stat…
字母板上的路径
Find the path to type a target string on an alphabet board using directional moves and the 'hash table plus string' patt…
最长公共子序列
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 day number of the year based on a given Gregorian calendar date in the format YYYY-MM-DD.
单字符重复子串的最大长度
Find the maximum length of a repeated character substring after swapping two characters using a sliding window approach …
拼写单词
Compute the total length of words that can be fully constructed from given characters using array scanning and hash mapp…
按字典序排在最后的子串
Identify the lexicographically last substring in a string using two-pointer scanning with invariant tracking efficiently…
查询无效交易
Detect invalid transactions by scanning arrays and cross-checking with hash tables for time, amount, and city conflicts …
比较字符串最小字母出现频次
Compare Strings by Frequency of the Smallest Character requires counting minimal character frequencies in words and quer…
构建回文串检测
Given a string and queries, determine if a substring can be rearranged and modified to form a palindrome.
猜字谜
Solve the "Number of Valid Words for Each Puzzle" problem with array scanning and hash lookup to efficiently count valid…
“气球” 的最大数量
Find the maximum number of times the word 'balloon' can be formed from characters of the given string.
反转每对括号间的子串
Reverse all substrings within matched parentheses using a stack-based approach for efficient state tracking and reversal…
交换字符串中的元素
Find the lexicographically smallest string by swapping characters in given pairs of indices.
尽可能使字符串相等
Optimize substring transformations using a binary search approach to maximize the change within a budget.
删除字符串中的所有相邻重复项 II
Remove all adjacent duplicates in the string using stack-based state management with a given threshold k.
分割平衡字符串
Split a string into the maximum number of balanced substrings where each substring has an equal number of 'L' and 'R'.
删除子文件夹
Remove sub-folders in a filesystem by filtering out folders nested inside other folders.
替换子串得到平衡字符串
Determine the minimum substring length to replace in order to balance a string of Q, W, E, and R characters efficiently.
串联字符串的最大长度
Find the maximum length of a concatenated string from an array with all unique characters using backtracking search with…
交换字符使得字符串相同
This problem requires determining the minimum number of swaps to make two strings equal by swapping characters between t…
移除无效的括号
Given a string with parentheses and letters, remove the fewest parentheses to produce any valid balanced string efficien…
得分最高的单词集合
Calculate the highest total score by selecting words from a list using available letters, respecting individual letter s…
搜索推荐系统
Design a search suggestion system that provides the top three lexicographically smallest products matching a search word…
分割回文串 III
Find the minimal character changes to split a string into k palindromes using precise dynamic programming state transiti…
字母组合迭代器
Implement an iterator that generates all combinations of a given length using efficient backtracking with pruning.
子串的最大出现次数
Find the maximum number of occurrences of any valid substring in a given string with specific constraints on letter coun…
口算难题
Check if a verbal arithmetic equation can be solved using a valid digit-letter mapping.
解码字母到整数映射
Decrypt a string using alphabet-to-integer mapping, considering the presence of '#' as a special delimiter.
让字符串成为回文串的最少插入次数
The problem asks to find the minimum number of insertions to convert a string into a palindrome using dynamic programmin…
不同的循环子字符串
Count the distinct non-empty substrings of a given string that can be formed as the concatenation of a string with itsel…
二指输入的的最小距离
Calculate the minimum total distance to type a word using two fingers on a keyboard, applying dynamic programming.
竖直打印单词
Transform a string into vertical columns by arranging each word character in array positions while trimming trailing spa…
破坏回文串
Given a palindrome, change exactly one character to make it non-palindromic and lexicographically smallest using a greed…
删除回文子序列
This problem challenges you to remove palindromic subsequences from a string with a minimum number of steps using two-po…
制造字母异位词的最小步骤数
Calculate the minimum steps to transform one string into an anagram of another using character replacements efficiently.
包含所有三种字符的子字符串数目
Count all substrings containing at least one of each character a, b, and c using a sliding window approach efficiently.
日期之间隔几天
Calculate the exact number of days between two dates using string parsing and arithmetic logic with consistent accuracy.
通过投票对团队排名
Rank Teams by Votes requires counting position-based votes and resolving ties with array scanning and hash lookup techni…
上升下降字符串
Reorder the string based on a specific algorithm using hash tables and string manipulation.
每个元音包含偶数次的最长子字符串
Find the longest substring with even counts of vowels using bitmasking and hash tables.
生成每种字符都是奇数个的字符串
Generate a string of n characters where each character appears an odd number of times, using a string-driven approach.
最长快乐前缀
Find the longest non-empty prefix of a string that also appears as its suffix, optimizing with rolling hash techniques.
设计地铁系统
Design an underground system to calculate travel times between stations using hash tables for efficient lookups and aver…
找到所有好字符串
Find all good strings between two given strings without including a specified evil substring using dynamic programming.
构造 K 个回文字符串
Determine if a string's characters can be rearranged to form exactly k non-empty palindrome strings using greedy validat…
将二进制表示减到 1 的步骤数
Determine the number of steps to reduce a binary representation of a number to 1 by following specific rules.
最长快乐字符串
Solve the "Longest Happy String" problem using a greedy approach with validation of invariants for constructing the long…
数组中的字符串匹配
Identify all strings in an array that appear as substrings of other strings, focusing on array and string matching patte…
HTML 实体解析器
Transform a string containing HTML entities into their character equivalents using a hash table for efficient parsing.
长度为 n 的开心字符串中字典序第 k 小的字符串
Given n and k, find the k-th lexicographical happy string of length n using backtracking search with pruning.
恢复数组
Calculate the number of arrays that can be restored from a string of digits where each number is within [1, k].
重新格式化字符串
Reformat The String involves rearranging alphanumeric characters in a string so that no adjacent characters have the sam…
点菜展示表
Generate a restaurant display table from orders by counting each food item per table using array scanning and hash looku…
数青蛙
Determine the minimum number of frogs required to sequentially produce all croaks in a mixed frog croak string efficient…
分割字符串的最大得分
Find the optimal split point in a binary string to maximize zeros on the left and ones on the right efficiently.
检查一个字符串是否可以打破另一个字符串
This problem checks whether one string can break another using permutations and a greedy approach for comparison.
旅行终点站
Find the destination city from a list of paths where each path connects two cities. The city with no outgoing path is th…
连续字符
Find the power of a string by determining the length of its longest substring with a unique character.
最简分数
Generate simplified fractions between 0 and 1 with denominators up to a given integer n.
重新排列句子中的单词
Rearrange words in a sentence by their length, maintaining original order for words of equal size for consistent output.
收藏清单
Identify people whose favorite companies lists are unique and not subsets of any other person's list using efficient arr…
检查单词是否为句中其他单词的前缀
Determine the first word in a sentence where a given searchWord is a prefix using two-pointer scanning with string match…
定长子串中元音的最大数目
Find the maximum number of vowels in a substring of a given length in a string using a sliding window approach.
检查一个字符串是否包含所有长度为 K 的二进制子串
Determine if every possible binary string of length k exists as a substring within a given binary string s efficiently u…
保证文件名唯一
This problem requires creating unique folder names by appending suffixes to duplicate names using an array scanning and …
判断路径是否相交
Check if a path crosses itself on a 2D plane using a hash table to track visited points during traversal.
最多 K 次交换相邻数位后得到的最小整数
Reorder digits using at most k adjacent swaps to produce the smallest possible integer, leveraging greedy selection effi…
转变日期格式
Reformat Date requires transforming a date string from human-readable form to YYYY-MM-DD using a string-driven strategy …
仅含 1 的子串数
Calculate the number of contiguous substrings containing only 1s in a binary string using a math and string approach eff…
最多的不重叠子字符串
Find the maximum number of non-overlapping substrings in a given string, ensuring no two substrings intersect unless one…
字符串的好分割数目
Count all valid splits of a string where left and right substrings have equal distinct characters, using efficient state…
重新排列字符串
Reorder characters in a string using a given indices array to reconstruct the intended output efficiently and correctly.
最少的后缀翻转次数
Find the minimum number of operations to convert a binary string to a target string using bit flips.
压缩字符串 II
Solve String Compression II with dynamic programming that tracks deletions, run boundaries, and digit-length jumps in co…
K 次操作转变字符串
Determine if string s can be transformed into t within k moves using character shifts and hash table counting efficientl…
平衡括号字符串的最少插入次数
Compute the minimum insertions to transform a parentheses string into a balanced string using efficient stack tracking.
找出最长的超赞子字符串
Find the maximum-length awesome substring in a numeric string using hash table and bit manipulation for palindrome poten…
整理字符串
This problem requires removing adjacent characters that cancel each other out, leveraging stack-based state management.
找出第 N 个二进制字符串中的第 K 位
Determine the k-th bit in the n-th binary string using a recursive construction that inverts and reverses previous strin…
千位分隔数
Convert a given integer into a string with dots as thousand separators using a precise string-driven strategy.
分割字符串的方案数
Count the number of ways to split a binary string into three non-empty parts with equal numbers of '1's.
替换所有的问号
Solve LeetCode 1576 by scanning left to right and replacing each ? with a letter different from its neighbors.
使绳子变成彩色的最短时间
Minimize the time Bob needs to remove balloons to make a rope colorful using dynamic programming with state transitions.
检查字符串是否可以通过排序子字符串得到另一个字符串
This problem requires checking if string 's' can be transformed into string 't' using substring sort operations.
重新排列单词间的空格
Rearrange spaces between words by distributing them evenly, placing any leftover spaces at the end to match original tex…
拆分字符串使唯一子字符串的数目最大
Maximize unique substrings in a string using backtracking with pruning and hash tables to track substrings.
文件夹操作日志搜集器
Simulate folder navigation based on a list of operations to determine the current folder depth.
警告一小时内使用相同员工卡大于等于三次的人
Solve LeetCode 1604 by grouping swipe times per employee, sorting each list, and scanning for any three within 60 minute…
括号的最大嵌套深度
Find the maximum nesting depth of parentheses in a valid string using stack-based state management.
分割两个字符串得到回文串
Determine if splitting two equal-length strings at a common index can form a palindrome using two-pointer scanning techn…
两个相同字符之间的最长子字符串
Find the longest substring between two equal characters using a hash table for optimized performance.
执行操作后字典序最小的字符串
Optimize a string through rotations and additions to get the lexicographically smallest possible result using string man…
按键持续时间最长的键
Determine which key had the longest press duration in a sequence using array indices and string mapping, resolving ties …
统计只差一个字符的子串数目
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…
字符频次唯一的最小删除次数
Determine the minimum deletions needed to ensure all character frequencies in a string are unique using a greedy approac…
使字符串平衡的最少删除次数
Determine the minimum number of deletions to transform a string of 'a' and 'b' into a balanced order using DP.
确定两个字符串是否接近
Check if two strings can transform into each other using letter swaps and frequency reorganizations, leveraging hash tab…
检查两个字符串数组是否相等
Determine if two string arrays form identical strings by concatenating elements in order, handling subtle array-length m…
具有给定数值的最小字符串
Find the lexicographically smallest string of length n with a given numeric value k using a greedy approach.
最大重复子字符串
Find the maximum number of times a given word repeats consecutively in a string using state transition dynamic programmi…
设计 Goal 解析器
Interpret the Goal Parser's output by analyzing a command string containing 'G', '()', and '(al)' patterns.
统计一致字符串的数目
Count the number of strings fully composed of allowed characters using array scanning and hash lookup for efficiency.
十-二进制数的最少数目
This problem asks to find the minimum number of deci-binary numbers needed to sum to a given number represented as a str…
重新格式化电话号码
Reformat a phone number by removing spaces and dashes, grouping digits into blocks of 3 or 2, and joining them with dash…
修改后的最大二进制字符串
The problem asks to maximize a binary string using specific operations to get the highest possible value.
判断字符串的两半是否相似
Check if two halves of a string contain the same number of vowels using a character counting approach efficiently.
删除子字符串的最大得分
Compute the highest score by greedily removing specific substrings using a stack to track state transitions efficiently.
替换隐藏数字得到的最晚时间
Determine the latest valid time by replacing hidden digits using a greedy choice and invariant validation strategy effic…
满足三条件之一需改变的最少字符数
This problem asks for the minimum operations to change two strings so that one of three conditions is met.
分割回文串 IV
The Palindrome Partitioning IV problem asks you to determine if a string can be split into three palindromic substrings.
删除字符串两端相同字符后的最短长度
Minimize string length by deleting similar characters from both ends repeatedly using a two-pointer technique.
构造字典序最大的合并字符串
Construct the lexicographically largest merge from two strings using a two-pointer greedy scanning approach efficiently.
生成交替二进制字符串的最少操作数
Find the minimum number of changes required to convert a string into an alternating binary string.
统计同质子字符串的数目
This problem requires counting all homogenous substrings in a given string and returning the result modulo 10^9 + 7.
最长的美好子字符串
Find the longest nice substring in a given string using the sliding window technique with running state updates.
交替合并字符串
Merge two strings alternately, starting with the first string, and append extra characters when one string is longer.
移动所有球到每个盒子所需的最小操作数
Solve the problem of finding the minimum operations to move balls to each box using an efficient approach with arrays an…
由子序列构造的最长回文串的长度
Maximize Palindrome Length From Subsequences explores dynamic programming to construct the longest palindrome from two s…
统计匹配检索规则的物品数量
Count Items Matching a Rule is an easy problem that tests array and string manipulation with conditions based on specifi…
所有子字符串美丽值之和
Calculate the total beauty of all substrings by counting character frequencies and computing frequency differences effic…
检查二进制字符串字段
Check if a binary string contains at most one contiguous segment of ones.
仅执行一次字符串交换能否使两个字符串相等
Check if one string swap can make two equal strings using hash table and string counting methods.
字符串中第二大的数字
Given a string with alphanumeric characters, find the second largest digit, or return -1 if it doesn’t exist.
字符串中不同整数的数目
Count all unique integers in a string by replacing letters and handling leading zeros correctly with a hash table approa…
替换字符串中的括号内容
Quickly evaluate a string with bracketed keys using array scanning and hash table lookups for efficient replacements.
判断国际象棋棋盘中一个格子的颜色
Determine whether a given chessboard square is white or black by converting coordinates using a math plus string approac…
句子相似性 III
Sentence Similarity III asks if one sentence can be transformed into another by inserting a sentence inside it.
截断句子
Truncate a sentence to contain only the first k words by converting it into an array of words.
使字符串有序的最少操作次数
Calculate the minimum operations to sort a string using combinatorial math and string manipulation techniques efficientl…
判断句子是否为全字母句
Determine if a given lowercase string contains every English letter using efficient hash table tracking techniques.
所有元音按顺序排布的最长子字符串
Find the longest substring of all vowels in order within a given string of vowels using sliding window technique.
将所有数字用字符替换
Transform a string by replacing digits at odd indices using the preceding character with a shift operation for accurate …
将字符串拆分为递减的连续值
Check if a string of digits can be split into descending consecutive values where the difference between them is 1.
邻位交换的最小次数
Find the minimum number of adjacent swaps to reach the kth smallest wonderful integer from a given number string.
将句子排序
Reconstruct a shuffled sentence by sorting words using their embedded indices to restore the original sentence order eff…
构成交替字符串需要的最小交换次数
This problem requires finding the minimum number of swaps to make a binary string alternating or determine if it's impos…
哪种连续子字符串更长
Determine if the longest segment of 1s in a binary string is strictly longer than the longest segment of 0s.
跳跃游戏 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…
长度为三且各字符不同的子字符串
Count all substrings of length three in a string where each character is unique using sliding window techniques efficien…
检查某单词是否等于两单词之和
Check if the sum of two word values equals a target word's value by converting letters to their numeric representations.
插入后的最大值
Solve Maximum Value after Insertion by greedily placing x at the first digit that makes the resulting signed number larg…
使二进制字符串字符交替的最少反转次数
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…
重新分配字符使所有字符串都相等
Determine if you can redistribute characters among strings so that all strings become identical using a counting approac…
可移除字符的最大数目
Use binary search and a subsequence check to find the largest removable prefix that still keeps p inside s.
字符串中的最大奇数
Find the largest odd number in a string using a greedy approach with careful digit inspection and invariant checks.
你完成的完整对局数
Solve this math plus string problem to calculate the number of full rounds played in a chess tournament between login an…
删除一个字符串中所有出现的给定子字符串
Remove all occurrences of a specified substring from a string using efficient stack-based state management.
最美子字符串的数目
Count the number of wonderful non-empty substrings of a given string based on frequency conditions of characters.
求和游戏
Determine if Alice can force a win in the Sum Game by strategically replacing '?' using a greedy and invariant approach.
长度为 3 的不同回文子序列
Count all unique length-3 palindromic subsequences in a string efficiently using hash tables and character positions.
可以输入的最大单词数
Determine how many words can be typed on a malfunctioning keyboard with some broken keys.
检查是否所有字符出现次数相同
Check if a string has characters with equal occurrences using hash tables and string manipulation techniques.
字符串转化后的各位数字之和
Convert a lowercase string into digits and repeatedly sum them k times using a direct string plus simulation approach.
子字符串突变后可能得到的最大整数
Find the largest integer by mutating a substring of a number using a mapping array for each digit.
删除系统中的重复文件夹
Solve Delete Duplicate Folders in System by building a trie, serializing child subtrees, and deleting repeated non-empty…
删除字符使字符串变好
This problem asks to remove the minimum number of characters from a string to ensure no three consecutive characters are…
两个回文子字符串长度的最大乘积
Find the maximum product of lengths of two non-overlapping odd-length palindromic substrings using string and rolling ha…
检查字符串是否为数组前缀
Determine if a string is a prefix of an array by concatenating initial elements, using two-pointer scanning efficiently.
使字符串平衡的最小交换次数
Determine the minimum swaps to balance a bracket string using two-pointer scanning with invariant tracking efficiently.
作为子字符串出现在单词中的字符串数目
Count how many strings in an array appear as substrings within a given word by checking each pattern individually.
使用特殊打字机键入单词的最少时间
Compute the minimum typing time by greedily taking the shorter circular move between consecutive letters, then adding on…
划分数字的方案数
Calculate the number of valid non-decreasing integer sequences from a string using state transition dynamic programming …
找出不同的二进制字符串
Find a binary string of length n not in the input array using array scanning and hash lookup efficiently.
找出数组中的第 K 大整数
This problem asks to find the kth largest integer in an array of string numbers, highlighting sorting and string-based c…
不同的好子序列数目
Find the number of unique good subsequences of a binary string using dynamic programming and modular arithmetic.
反转单词前缀
Reverse the prefix of a string starting from index 0 to the first occurrence of a given character.
两个回文子序列长度的最大乘积
Find two disjoint palindromic subsequences in a string to maximize the product of their lengths efficiently using dynami…
执行操作后的变量值
Compute the final value of X by simulating each string operation in the array sequentially with careful tracking.
重复 K 次的最长子序列
Find the longest subsequence repeated k times in a string using backtracking search with pruning.
解出数学表达式的学生分数
Calculate student scores for a single-digit math expression using state transition dynamic programming to track all vali…
连接后等于目标字符串的字符串对
Count all unique index pairs in a string array whose concatenation exactly matches the given target string using efficie…
考试的最大困扰度
Maximize the Confusion of an Exam requires adjusting at most k answers to create the longest consecutive true or false s…
转换字符串的最少操作次数
Minimize moves to convert a string of 'X' and 'O' to all 'O' by converting three consecutive characters to 'O'.
含特定字母的最小子序列
Find the lexicographically smallest subsequence of length k with at least repetition occurrences of a given letter using…
如果相邻两个颜色均相同则删除当前颜色
Alice and Bob play a game removing colored pieces; Alice wins if she makes the last valid move.
检查句子中的数字是否递增
Check if the numbers in a sentence are strictly increasing from left to right using string tokenization.
句子中的有效单词数
Count all valid words in a sentence by analyzing each token with precise string-driven validation rules efficiently.
数组中第 K 个独一无二的字符串
Find the kth distinct string in an array by identifying strings that appear only once, using efficient array scanning an…
蜡烛之间的盘子
Determine the number of plates between candles in a given substring using binary search and prefix sum techniques.
棋盘上有效移动组合的数目
Given a set of pieces on a chessboard, calculate the number of valid move combinations without overlap using backtrackin…
同源字符串检测
Determine if there exists an original string that could produce both encoded inputs using state transition dynamic progr…
统计字符串中的元音子字符串
Count the number of vowel substrings that include all five vowels in a string.
所有子字符串中的元音
Compute the total number of vowels in all substrings of a given string using efficient state transition dynamic programm…
检查两个字符串是否几乎相等
Solve Check Whether Two Strings are Almost Equivalent by counting letters and rejecting any character whose frequency ga…
解码斜向换位密码
Decode the Slanted Ciphertext problem requires decoding a slanted cipher using string manipulation and simulation based …
统计出现过一次的公共字符串
Learn how to efficiently count strings appearing exactly once in both arrays using array scanning and hash lookup patter…
喂食仓鼠的最小食物桶数
Find the minimum number of food buckets required to feed all hamsters, using dynamic programming and greedy techniques.
从二叉树一个节点到另一个节点每一步的方向
Find the shortest path between two nodes in a binary tree and output the directions as a string of 'L', 'R', and 'U'.
环和杆
Count how many rods have all three colors using a hash table to track colors per rod efficiently in strings.
找出数组中的第一个回文字符串
Return the first palindromic string from an array of words or an empty string if none exists.
向字符串添加空格
Learn to efficiently insert spaces in a string using two-pointer scanning with invariant tracking in linear time.
句子中的最多单词数
Find the maximum number of words in a single sentence from an array of sentences using array and string processing techn…
从给定原材料中找到所有可以做出的菜
Determine all recipes you can prepare given initial supplies and ingredient dependencies, leveraging array scanning and …
判断一个括号字符串是否有效
Determine if a parentheses string can be transformed into a valid sequence considering locked positions using stack logi…
执行所有后缀指令
Simulate robot moves from every instruction index on an n x n grid, counting valid steps without leaving boundaries.
检查是否所有 A 都在 B 之前
Determine if all 'a's in a string appear before any 'b's using a direct string-driven check strategy for clarity and cor…
银行中的激光束数量
Calculate total laser beams in a bank floor plan using array counting and math logic between security devices on differe…
将标题首字母大写
Capitalize the Title requires transforming each word based on length, applying uppercase and lowercase rules precisely p…
连接两字母单词得到的最长回文串
Find the maximum-length palindrome by combining two-letter words using array scanning and hash table lookups efficiently…
统计追加字母可以获得的单词数
Given startWords and targetWords, check how many targetWords can be formed by adding one letter and rearranging letters …
将字符串拆分为若干长度为 k 的组
Divide a string into equal groups of size k, using a fill character to complete the last group if needed.
分隔长廊的方案数
Calculate the number of ways to split a corridor into sections with exactly two seats using dynamic programming efficien…
查找给定哈希值的子串
Locate the first substring of length k whose rolling hash matches the given hashValue using a sliding window approach.
字符串分组
Group words into connected sets using operations on characters with string and bit manipulation techniques.
设计位集
Master the Design Bitset problem by efficiently managing bit flips, counts, and indexed updates with array and hash look…
移除所有载有违禁货物车厢所需的最少时间
Determine the minimum time to remove all cars with illegal goods using state transition dynamic programming efficiently.
构造限制重复的字符串
Construct a lexicographically largest string from a given string with no letter appearing more than a repeatLimit times …
统计包含给定前缀的字符串
Count how many words in a list start with a given prefix.
制造字母异位词的最小步骤数 II
Compute the fewest character insertions needed to turn two strings into anagrams using hash table frequency counts effic…
得到回文串的最少操作次数
The problem challenges you to find the minimum number of adjacent swaps to make a string a palindrome.
Excel 表中某个范围内的单元格
This problem requires extracting a range of cells from an Excel-like sheet based on a string input and returning them in…
字符串中最多数目的子序列
Maximize the number of subsequences by optimally adding a character to a given string to match a specified pattern.
用地毯覆盖后的最少白色砖块
Find the minimum number of white tiles visible after optimally placing carpets using state transition dynamic programmin…
统计道路上的碰撞次数
Count Collisions on a Road is a problem where you calculate the number of car collisions based on their movements in a s…
由单个字符重复的最长子字符串
Solve Longest Substring of One Repeating Character by maintaining mergeable run information under character updates afte…
选择建筑的方案数
Solve Number of Ways to Select Buildings by counting alternating 3-building patterns with state transitions over the bin…
构造字符串的总得分和
Calculate the sum of scores of built strings by analyzing longest common prefixes with suffixes in a string using effici…
转化时间需要的最少操作数
The problem asks to find the minimum number of operations to convert one time string to another using specific time incr…
加密解密字符串
The 'Encrypt and Decrypt Strings' problem involves creating a data structure that can encrypt and decrypt strings using …
向表达式添加括号后的最小结果
Enumerate every valid parenthesis placement around the plus sign and choose the expression with the smallest evaluated p…
计算字符串的数字和
Learn how to repeatedly sum digit groups in a string until its length is at most k using string simulation techniques.
相邻字符不同的最长路径
Find the longest path in a tree where adjacent nodes have different characters using graph DFS and topological reasoning…
统计是给定字符串前缀的字符串数目
Count Prefixes of a Given String is a problem that involves finding the number of string prefixes in an array that match…
移除指定数字得到的最大结果
Determine the largest possible number by removing one specific digit using a greedy approach and string iteration.
字符串的总引力
Calculate the total appeal of all substrings by counting distinct characters efficiently using state transition DP and h…
字符串中最大的 3 位相同数字
Find the largest 3-same-digit number within a string of digits using a string-driven solution approach.
统计打字方案数
Calculate the total number of possible original texts from a pressed key sequence using state transition dynamic program…
找到一个数字的 K 美丽值
Calculate the k-beauty of a number by counting substrings of length k that divide the original number evenly using a sli…
移除字母异位词后的结果数组
This problem requires removing adjacent anagrams from a list of words using an array scanning and hash lookup approach.
字母在字符串中的百分比
Calculate the percentage of a specific letter in a string using a direct string-driven counting approach, rounding down …
判断一个数的数字计数是否等于数位的值
Determine if a number's digits correspond to their counts in the string representation.
最多单词数的发件人
Find the sender with the largest total word count by scanning messages and tallying counts using a hash table efficientl…
重排字符形成目标字符串
Calculate the maximum copies of a target string from letters in s using frequency counting and hash tables efficiently.
价格减免
Apply Discount to Prices involves updating a sentence by applying a percentage discount to price words, with precise for…
设计一个文本编辑器
Design a text editor that supports text manipulation and cursor navigation operations efficiently with linked-list-based…
强密码检验器 II
Check if a given password meets all strength requirements, including length, character types, and no adjacent repeated c…
替换字符后匹配
Determine if a target substring can appear in a string after optional character replacements using given mappings effici…
公司命名
The "Naming a Company" problem requires determining the number of valid distinct company names from a list of name ideas…
兼具大小写的最好英文字母
Find the greatest English letter that exists in both lowercase and uppercase in a string using a hash table approach.
小于等于 K 的最长二进制子序列
Find the longest subsequence in a binary string that forms a number less than or equal to a given integer k.
统计星号
The 'Count Asterisks' problem asks you to count '*' excluding those between pairs of '|' in a string.
解密消息
Decode the Message is an easy problem involving hash table mapping for string decoding based on a cipher key.
移动片段得到字符串
Determine if the pieces in start can be moved to form target using two-pointer scanning and strict left-right movement r…
裁剪数字后查询第 K 小的数字
Solve the Query Kth Smallest Trimmed Number problem by efficiently trimming and sorting strings in an array to answer qu…
第一个出现两次的字母
Find the first letter that repeats in a string using hash table tracking and early detection for efficiency.
设计食物评分系统
Design a food rating system that tracks and updates ratings of foods, finding the highest rated items by cuisine.
最长理想子序列
The Longest Ideal Subsequence problem involves finding the longest subsequence where each character has a difference of …
根据模式串构造最小数字
Construct the lexicographically smallest string that fits the increasing and decreasing conditions of a given pattern.
得到 K 个黑块的最少涂色次数
Given a string of blocks, determine the minimum number of recolors needed to get k consecutive black blocks.
二进制字符串重新安排顺序需要的时间
Calculate the exact seconds required to convert all 01 pairs into 10 in a binary string using state transitions.
字母移位 II
Shift letters in a string using a sequence of range-based forward or backward operations efficiently with prefix sums.
最大回文数字
Form the largest palindromic number from a string of digits while maintaining a valid palindrome structure.
从字符串中移除星号
Remove all stars from a string by simulating the removal process using a stack to manage characters and stars efficientl…
收集垃圾的最少总时间
This problem asks you to find the minimum amount of time needed to collect all garbage in a city, focusing on array and …
检查相同字母间的距离
Verify if each pair of identical letters in a string has the exact number of letters between them as specified in a dist…
子字符串的最优划分
Given a string s, partition it into substrings with unique characters and return the minimum number of substrings.
统计共同度过的日子数
Count the total number of days Alice and Bob are in Rome together, given their arrival and departure dates.
最长的字母序连续子字符串的长度
Find the length of the longest continuous alphabetical substring from a given string of lowercase letters.
字符串的前缀分数和
The 'Sum of Prefix Scores of Strings' problem involves calculating prefix scores for strings based on their occurrences …
按身高排序
Sort the People requires pairing names with heights and sorting them in descending height order efficiently using arrays…
删除字符使频率相同
Determine if removing a single letter from a string can make all remaining letters have identical frequency efficiently.
对字母串可执行的最大删除数
Find the maximum number of deletions on a string using state transition dynamic programming and rolling hash techniques …
使用机器人打印字典序最小的字符串
Solve the problem of using a robot to print the lexicographically smallest string with stack-based state management.
有效时间的数目
Calculate how many valid digital clock times can be formed by replacing unknown digits in a string format hh:mm.
判断两个事件是否存在冲突
Compare two same-day time intervals and check whether their inclusive endpoints overlap after converting HH:MM strings i…
差值数组不同的字符串
Identify the one string in an array whose consecutive letter differences deviate from all others using array scanning pl…
距离字典两次编辑以内的单词
Identify all words in queries that can match dictionary entries with at most two character changes efficiently using arr…
最流行的视频创作者
Identify the most popular video creator by summing views and selecting their top-viewed video with array and hash patter…
根据限制分割消息
Split Message Based on Limit requires dividing a string into parts with length constraints using a calculated suffix pat…
不重叠回文子字符串的最大数目
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…
商店的最少代价
Determine the earliest closing hour of a shop to minimize penalty using a string of customer visits and prefix sums.
统计回文子序列数目
Count the number of palindromic subsequences of length 5 in a given string of digits.
追加字符以获得子序列
Determine the minimum characters to append to s so t becomes a subsequence using efficient two-pointer scanning techniqu…
回环句
Determine if a sentence is circular by verifying each word's last character matches the next word's first character effi…
数组中字符串的最大值
The problem requires finding the maximum value of alphanumeric strings in an array based on length or numeric value.
统计相似字符串对的数目
Count similar string pairs by converting each word into a character-set signature and counting matching signatures effic…
奖励最顶尖的 K 名学生
Calculate top K student scores by scanning reports and using hash tables for positive and negative word lookups efficien…
统计同位异构字符串数目
Learn to count distinct anagrams for a multi-word string using hash tables, math, and combinatorics efficiently.
到目标字符串的最短距离
Find the shortest distance to a target string in a circular array with either left or right movement options.
每种字符至少取 K 个
Find the minimum number of minutes needed to take at least k of each character from both ends of a string.
将字符串分割成值不超过 K 的子字符串
Determine the minimum number of substrings from a numeric string such that each substring value does not exceed k using …
使字符串中不同字符的数目相等
Determine if a single swap can equalize distinct character counts between two strings using hash tables for tracking fre…
执行逐位运算使字符串相等
Determine if a binary string s can be transformed into target using repeated bitwise operations on paired indices effici…
统计范围内的元音字符串数
Count the number of strings that start and end with a vowel in given ranges within an array of words.
子字符串异或查询
Solve the Substring XOR Queries problem using array scanning and hash lookup to efficiently handle multiple queries on b…
最少得分子序列
Find the minimum score of a string by removing characters from t while maintaining subsequence validity with s.
找出对应 LCP 矩阵的字符串
Determine the lexicographically smallest string matching a given LCP matrix using state transition dynamic programming.
找出字符串的可整除数组
Calculate the divisibility array for a string by checking if prefixes are divisible by a given number.
统计范围内的元音字符串数
Count the Number of Vowel Strings in Range asks to count vowel strings in a subarray of a given word list.
找到最大开销的子字符串
Find the Substring With Maximum Cost requires calculating substring values using a hash lookup for character costs, with…
最长平衡子字符串
Find the longest balanced substring of a binary string where zeroes precede ones and counts of each are equal.
构造有效字符串的最少插入数
Determine the minimum insertions required to transform a given string into repeated concatenations of 'abc' using dynami…
字典序最小的美丽字符串
Find the lexicographically smallest beautiful string larger than the given string using greedy choice and invariant vali…
老人的数目
Determine how many passengers are over 60 years old based on their compressed details in an array of strings.
删除子串后的字符串最小长度
Determine the smallest string length after repeatedly removing AB or CD substrings using stack-based simulation techniqu…
字典序最小回文串
Given a string, make it a palindrome with the fewest operations, prioritizing lexicographically smallest result.
字符串中的额外字符
The problem asks for the minimum number of extra characters left after optimally breaking a string into substrings found…
移除字符串中的尾随零
Remove trailing zeros from a string representing a positive integer number.
使所有字符相等的最小成本
Find the minimum cost to make all characters of a binary string equal by performing two types of operations.
最小化字符串长度
Minimize String Length asks you to reduce a string by removing duplicates using a Hash Table strategy efficiently.
统计整数数目
Count of Integers challenges you to find the number of integers with a digit sum between a given range using dynamic pro…
找到最长的半重复子字符串
Find the length of the longest substring where at most one adjacent pair of digits repeats, using a sliding window appro…
执行子串操作后的字典序最小字符串
Given a string, perform operations to make it lexicographically smaller using a greedy approach with substring modificat…
最大字符串配对数目
Find the maximum number of pairs of distinct strings from an array where one string is the reverse of the other.
字符串连接删减字母
Solve the Decremental String Concatenation problem by applying dynamic programming to minimize string length after conca…
将字符串分割为最少的美丽子字符串
Partition a binary string into the fewest beautiful substrings using state transition dynamic programming and careful su…
最长合法子字符串的长度
This problem asks for the longest valid substring of a word that doesn't contain any substrings from a forbidden list.
将字符串中的元音字母排序
Sort Vowels in a String requires identifying vowels in a string and rearranging them in ascending order while keeping co…
按分隔符拆分字符串
Split Strings by Separator requires iterating through an array of strings and splitting each by a given separator charac…
包含三个字符串的最短字符串
Find the shortest string containing three given strings using a greedy approach while ensuring it is lexicographically s…
统计范围内的步进数字数目
Count the stepping numbers in a range using dynamic programming with state transitions between digits.
故障键盘
Simulate typing on a faulty keyboard where pressing 'i' reverses the string, requiring careful string manipulation track…
循环增长使字符串子序列等于另一个字符串
Determine if str2 can be made a subsequence of str1 by incrementing characters cyclically using at most one operation.
判别首字母缩略词
Check if a string can be formed by concatenating the first letters of each word in a given list.
距离原点最远的点
Determine the maximum distance from origin using string moves and counting underscores optimally for efficient calculati…
判断通过操作能否让字符串相等 I
Determine if two strings can be made equal by repeatedly swapping characters at any two indices in each string.
判断通过操作能否让字符串相等 II
Check if two strings can be made equal using operations that swap characters with the same parity.
统计一个字符串的 k 子序列美丽值最大的数目
Determine the number of k-length unique subsequences in a string that maximize the sum of character frequencies efficien…
生成特殊数字的最少操作
Minimize operations to make a number divisible by 25 by deleting digits. Use greedy choice and invariant validation.
字符串转换
Find how many ways string s can be transformed into string t in exactly k operations using suffix rotations.
最大二进制奇数
Rearrange a binary string to form the largest odd binary number using a greedy approach and least significant bit valida…
执行操作使两个字符串相等
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…
最短且字典序最小的美丽子字符串
Find the shortest beautiful substring in a binary string and return the lexicographically smallest option efficiently us…
得到 K 个半回文串的最少修改次数
Minimize the number of letter changes to partition a string into k semi-palindromes using dynamic programming and two po…
使二进制字符串变美丽的最少修改次数
This problem involves determining the minimum number of changes to make a binary string beautiful using string-driven st…
高访问员工
Identify employees with high system access within one-hour periods based on access logs.
使三个字符串相等
Determine the minimum number of operations to make three strings equal by removing rightmost characters from one string …
区分黑球与白球
Solve the "Separate Black and White Balls" problem by swapping adjacent balls to group all black balls to the right with…
查找包含给定字符的单词
Identify all indices of words containing a specific character using array and string traversal techniques efficiently.
统计美丽子字符串 I
Given a string and a value k, count the number of beautiful substrings where vowels * consonants % k == 0.
统计美丽子字符串 II
Count Beautiful Substrings II focuses on finding beautiful substrings with hash tables and number theory techniques.
统计完全子字符串
Count Complete Substrings involves finding substrings where each character appears exactly k times with constraints on a…
消除相邻近似相等字符
Minimize operations to remove adjacent almost-equal characters using dynamic programming and greedy methods.
转换字符串的最小成本 I
This problem asks to calculate the minimum cost to convert a string from source to target using specific character trans…
转换字符串的最小成本 II
Compute the minimum cost to transform source into target using substring replacements with given costs efficiently using…
找出出现至少三次的最长特殊子字符串 I
Find the longest special substring in a string that appears at least three times, or return -1 if no such substring exis…
找出出现至少三次的最长特殊子字符串 II
Find the longest special substring that occurs at least three times in a given string using binary search and hash table…
回文串重新排列查询
Given a string and queries, check if rearranging specified substrings can make the string a palindrome.
统计强大整数的数目
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 …
找出数组中的美丽下标 I
Identify all beautiful indices where substring a appears and a nearby substring b exists within distance k efficiently.
找出数组中的美丽下标 II
Find Beautiful Indices in the Given Array II challenges you to use binary search and string matching techniques.
输入单词需要的最少按键次数 I
Calculate the minimum pushes to type a word using a remapped telephone keypad with greedy allocation of letters.
输入单词需要的最少按键次数 II
Given a word, find the minimum number of pushes to type it on a remapped keypad using a greedy approach.
按键变更的次数
Count how many times a user switches keys in a typed string, ignoring shift and caps lock variations in characters.
将单词恢复初始状态所需的最短时间 I
Determine the minimum seconds to revert a string to its original state using repeated prefix shifts of length k efficien…
将单词恢复初始状态所需的最短时间 II
The problem asks to calculate the minimum time required to revert a string to its initial state using specific operation…
回文字符串的最大数量
The problem focuses on maximizing the number of palindromes that can be formed from a given list of words through specif…
统计前后缀下标对 I
Count all index pairs where one word is both a prefix and suffix of another, using efficient array and string checks.
最长公共前缀的长度
Determine the length of the longest common prefix between two integer arrays using array scanning and hash lookup effici…
统计前后缀下标对 II
Count the number of index pairs in a string array where one word is both a prefix and suffix of another using array and …
数组中的最短非公共子字符串
Find the shortest substring for each string in an array that does not appear in any other string efficiently using hashi…
替换字符串中的问号使分数最小
Minimize the cost of a string with '?' characters by replacing them with letters in lexicographical order while minimizi…
字符串及其反转中是否存在同一子字符串
Check for any substring of length 2 in a string and its reverse using a hash table and string comparison.
统计以给定字符开头和结尾的子字符串总数
Given a string and a character, find the total number of substrings that start and end with that character.
成为 K 特殊字符串需要删除的最少字符数
Minimize deletions to make a string k-special by adjusting character frequencies.
每个字符最多出现两次的最长子字符串
Find the maximum length substring where some substring occurs at least twice using a sliding window and hash mapping str…
最长公共后缀查询
Find the index of the string in wordsContainer with the longest common suffix for each query efficiently using array and…
满足距离约束且字典序最小的字符串
Minimize a string lexicographically using a series of operations constrained by a given integer k.
字符串的分数
Calculate the sum of absolute ASCII differences between adjacent characters to score any given string efficiently.
替换字符可以得到的最晚时间
Given a time string with "?" characters, replace them to form the latest valid 12-hour time.
统计特殊字母的数量 I
Count the number of special characters in a given string using hash tables and string manipulation.
统计特殊字母的数量 II
Count the Number of Special Characters II is a medium difficulty string and hash table problem that involves identifying…
有效单词
Determine if a given string qualifies as a valid word using a string-driven solution pattern with explicit character rul…
K 周期字符串需要的最少操作次数
The problem requires calculating the minimum number of operations to make a string k-periodic using specific substring r…
同位字符串连接的最小长度
The problem asks to find the minimum length of a string t such that s is a concatenation of anagrams of t.
正方形中的最多点数
Find the maximum number of points inside a valid square centered at the origin using a scanning and hashing approach.
分割字符频率相等的最少子字符串
Partition a string into substrings with equal character frequencies using dynamic programming and state transitions.
两个字符串的排列差
Compute the total index difference between two strings by mapping characters and summing their positional distances effi…
压缩字符串 III
Compress a string by repeatedly taking maximal same-character prefixes, following a string-driven solution strategy effi…
候诊室中的最少椅子数
Calculate the minimum number of chairs needed in a waiting room using string simulation and event tracking efficiently.
删除星号以后字典序最小的字符串
Find the lexicographically smallest string by removing stars using stack-based state management and careful character se…
清除数字
Remove all digits from a given string by applying a repeated operation to form the final string without digits.
找出加密后的字符串
In this problem, you need to encrypt a string by shifting each character's position based on a given integer value.
生成不含相邻零的二进制字符串
Generate all binary strings of length n without adjacent zeros using backtracking search with pruning for efficient enum…
最小代价构造字符串
This problem asks you to construct a target string using given words at minimal cost using dynamic programming technique…
交换后字典序最小的字符串
Lexicographically Smallest String After a Swap involves finding the smallest string after swapping adjacent digits with …
操作后字符串的最短长度
Find the minimum length of a string after performing operations based on character frequency.
字符串元音游戏
Solve the Vowels Game in a String using optimal moves and string analysis to predict the winner efficiently and accurate…
将 1 移动到末尾的最大操作次数
This problem requires finding the maximum number of operations to move ones to the end of a binary string.
统计 1 显著的字符串的数量
Count the number of substrings in a binary string with dominant ones, using a sliding window approach with state updates…
矩阵中的蛇
Solve the Snake in Matrix problem by simulating the snake's movement in a grid based on a series of directional commands…
统计满足 K 约束的子字符串数量 I
Count all substrings in a binary string that meet a given k-constraint using an efficient sliding window approach.
找出最大的 N 位 K 回文数
Compute the largest n-digit integer divisible by k that forms a palindrome using state transition dynamic programming te…
统计满足 K 约束的子字符串数量 II
Count Substrings That Satisfy K-Constraint II requires finding valid substrings in a binary string based on a k-constrai…
哈希分割字符串
Hash Divided String requires splitting a string into equal parts and combining character values modulo 26 to form a new …
检查棋盘方格颜色是否相同
Determine if two chessboard squares share the same color using coordinate math and simple string manipulation for quick …
将日期转换为二进制表示
Convert a given Gregorian date string to its binary format by transforming year, month, and day individually without lea…
形成目标字符串需要的最少字符串数 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 if a message contains at least two banned words using array scanning and hash lookup.
统计重新排列后包含另一个字符串的子字符串数目 I
Count the number of valid substrings in word1 that can be rearranged to contain word2 as a prefix.
统计重新排列后包含另一个字符串的子字符串数目 II
Count Substrings That Can Be Rearranged to Contain a String II involves identifying valid substrings with a sliding wind…
字典序最小的合法序列
Determine the lexicographically smallest valid index sequence by using state transition dynamic programming over word1 a…
第一个几乎相等子字符串的下标
Locate the first substring in s that is almost equal to pattern by allowing at most one character mismatch efficiently.
元音辅音字符串计数 I
Count all substrings containing every vowel and exactly k consonants using a sliding window and hash map state tracking.
元音辅音字符串计数 II
Count the number of substrings containing all vowels and exactly k consonants using a sliding window technique.
从原字符串里进行删除操作的最多次数
Determine the maximum number of characters you can remove from source while keeping pattern as a subsequence using array…
统计能获胜的出招序列数
Count The Number of Winning Sequences is a dynamic programming challenge involving state transitions based on Alice’s cr…
出现在屏幕上的字符串序列
Simulate Alice typing a target string with a special keyboard that appends letters one by one. Solve using string simula…
字符至少出现 K 次的子字符串 I
Calculate the total number of substrings where at least one character repeats k times using a sliding window efficiently…
判断 DFS 字符串是否是回文串
Determine if strings formed by DFS traversal of a tree are palindromes using array scanning and hash lookups efficiently…
找到初始输入字符串 I
Determine the length of the original string Alice intended to type by analyzing repeated characters and clumsy key press…
修改后子树的大小
Calculate the sizes of all subtrees after simultaneous parent changes using array scanning and hash-based counting effic…
找到初始输入字符串 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…
字符串转换后的长度 II
Calculate the length of a string after repeated transformations using state transition dynamic programming for large t v…
检查平衡字符串
Determine if a numeric string is balanced by comparing sums of digits at even and odd positions efficiently.
统计平衡排列的数目
Determine how many distinct permutations of a digit string are balanced using state transition dynamic programming effic…
最小可整除数位乘积 II
Find the smallest zero-free number at least as large as num whose digits multiply to a product divisible by t using care…
统计小于 N 的 K 可约简整数
This problem challenges you to count the K-reducible numbers less than a given binary integer using dynamic programming.
两个字符串的切换距离
Find the minimum cost of transforming one string into another, considering operations between characters.
重排子字符串以形成目标字符串
Determine if s can be split into k equal substrings and rearranged to match t using a hash table for frequency tracking.
两天自由外汇交易后的最大货币数
Compute the maximum currency amount after two days using graph traversal and depth-first search for optimal conversions.
使字符频率相等的最少操作次数
This Hard problem asks to transform a string so all character frequencies match using minimal deletions, leveraging dyna…
字符相同的最短子字符串 II
Find the minimal length of a substring with identical characters using binary search and controlled character flips effi…
从盒子中找出字典序最大的字符串 I
This problem involves finding the lexicographically largest string from a given word using a two-pointer approach.
子字符串匹配模式
Determine if a pattern containing a single wildcard can match any substring of a given string efficiently.
计算字符串的镜像分数
Calculate the mirror score of a string using stack-based state management for matching letters efficiently and accuratel…
最短公共超序列的字母出现频率
Compute all unique shortest common supersequences of given words using graph indegree tracking and topological ordering …
找到字符串中合法的相邻数字
Identify the first valid adjacent digit pair in a string where each digit appears exactly as many times as its numeric v…
变成好标题的最少代价
Solve Minimum Cost Good Caption with dynamic programming that builds minimum edit cost while enforcing character runs of…
奇偶频次间的最大差值 I
Find the maximum difference between the frequency of characters in a string with odd and even frequencies.
K 次修改后的最大曼哈顿距离
Solve Maximum Manhattan Distance After K Changes by scanning prefixes and testing the four diagonal target pairs with li…
奇偶频次间的最大差值 II
Find the maximum difference between even and odd character frequencies in substrings using sliding window updates effici…
统计可以被最后一个数位整除的子字符串数目
Count the number of substrings in a string divisible by their last non-zero digit using dynamic programming.
最短匹配子字符串
Find the shortest substring in a string that matches a pattern with exactly two wildcards efficiently using binary searc…
找出长度为 K 的特殊子字符串
Check efficiently if a string contains a consecutive sequence of length k where all characters match exactly one distinc…
选择 K 个互不重叠的特殊子字符串
Determine if k non-overlapping special substrings exist in a string using dynamic programming and careful substring trac…
判断操作后字符串中的数字是否相等 I
Simulate repeated adjacent digit sums modulo 10 until two digits remain, then check whether those final digits match.
判断操作后字符串中的数字是否相等 II
Determine if repeated digit-sum operations on a numeric string reduce it to two equal digits using math and string techn…
至多 K 次操作后的最长回文子序列
Find the longest palindromic subsequence of a string after performing at most k operations to adjust letters.
字典序最小的生成字符串
Generate the lexicographically smallest string by merging str1 and str2 using a greedy approach with invariant checks.
设计电子表格
Design a spreadsheet that supports setting, retrieving, and resetting values, with the ability to handle formulas refere…
删除元素后 K 个字符串的最长公共前缀
Find the longest common prefix length of k strings after removing an element in the array.
字符串的反转度
Calculate the reverse degree of a string by simulating operations on its characters based on their positions in the alph…
操作后最大活跃区段数 I
Maximize the number of active sections in a binary string by performing at most one trade operation.
操作后最大活跃区段数 II
Maximize the number of active sections in a binary string with at most one trade.
子字符串连接后的最长回文串 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…
最小回文排列 I
Build the smallest palindrome by sorting the left half counts and mirroring them around the optional middle character.
最小回文排列 II
Find the k-th lexicographically smallest palindromic rearrangement of a given palindromic string s.
统计逐位非递减的整数
Count all integers between l and r whose digits never decrease in base b using state transition dynamic programming effi…
执行指令后的得分
Simulate a series of add and jump instructions on arrays to compute the final score efficiently using array scanning and…
找到最常见的回答
Find the most common survey response after eliminating duplicates within each day, using array scanning and hash lookups…
统计水平子串和垂直子串重叠格子的数目
Efficiently count grid cells appearing in both horizontal and vertical occurrences of a given string pattern using array…
找到频率最高的元音和辅音
Given a string, calculate the sum of the most frequent vowel and consonant frequencies.
不同字符数量最多为 K 时的最少删除数
You need to delete characters in a string to reduce its distinct characters to at most k.
最大质数子字符串之和
Compute the sum of the three largest unique primes from all substrings using hash table plus math efficiently.
不相交子字符串的最大数量
Determine the maximum number of non-overlapping substrings in a word, each at least four characters and matching start-e…
移除相邻字符
This problem focuses on removing adjacent characters in a string using a stack-based approach until no more operations a…
移除相邻字符后字典序最小的字符串
Find the lexicographically smallest string by repeatedly removing adjacent characters optimally using dynamic programmin…
字符串转换需要的最小操作数
Transform word1 into word2 using minimal operations on substrings with a dynamic programming state transition approach.
为视频标题生成标签
Transform a video caption into a valid hashtag by simulating capitalization rules and truncation for long words efficien…
分割字符串
Partition a string into unique segments using hash table and string manipulation.
相邻字符串之间的最长公共前缀
Given an array of strings, find the longest common prefix length between adjacent strings after removals at each index.
十六进制和三十六进制转化
Solve Hexadecimal and Hexatrigesimal Conversion by converting n squared to base 16 and n cubed to base 36, then joining …
优惠券校验器
The Coupon Code Validator problem requires filtering and sorting coupons based on specific criteria for validity.
用特殊操作处理字符串 I
Simulate a series of operations on a string to transform it into the desired result using special characters.
用特殊操作处理字符串 II
Solve the problem of processing strings with special operations like '*' and '#' by simulating the rules left-to-right.
图中的最长回文路径
Find the longest path in a graph that forms a palindrome using state transition dynamic programming and bitmask techniqu…