题库chevron_right分类chevron_right字符串
text_fields

字符串

699 道题目
简单: 212中等: 329困难: 158

字符串 是技术面试里最常出现的能力维度之一。建议先掌握基础题型的边界处理,再逐步过渡到模式识别和复杂度 trade-off。

面试场景

高频考察问题建模、边界条件与口头表达的清晰度。

常见误区

只背模板不解释为什么,容易在追问里失分。

练习策略

每轮练 3-5 题,固定复盘复杂度和可替代解法。

推荐练习顺序

#题目难度
3

无重复字符的最长子串

Find the length of the longest substring without repeating characters using a sliding window and hash map to track state…

中等
5

最长回文子串

Find the longest contiguous palindromic substring in a given string using dynamic programming and two-pointer expansion …

中等
6

Z 字形变换

Convert a string into a zigzag pattern across multiple rows and read it line by line efficiently for string manipulation…

中等
8

字符串转换整数 (atoi)

Convert a string to a 32-bit signed integer by carefully parsing characters, handling signs, and ignoring invalid traili…

中等
10

正则表达式匹配

The Regular Expression Matching problem involves checking if a string matches a pattern using '.' and '*'.

困难
12

整数转罗马数字

Convert a given integer to its Roman numeral representation using hash table mapping and decimal place math operations e…

中等
13

罗马数字转整数

Convert a Roman numeral string into an integer using a hash table and mathematical principles to determine value order.

简单
14

最长公共前缀

Find the longest common prefix in an array of strings, returning an empty string if none exists.

简单
17

电话号码的字母组合

Generate all letter combinations a digit string can represent using backtracking with pruning, leveraging hash table map…

中等
20

有效的括号

Determine if a string of parentheses, brackets, and braces is correctly nested using a stack for proper order validation…

简单
22

括号生成

Generate Parentheses requires generating all valid combinations of parentheses with given pairs using backtracking and s…

中等
28

找出字符串中第一个匹配项的下标

Locate the first occurrence of a substring within a string using a two-pointer scanning strategy and invariant tracking …

简单
30

串联所有单词的子串

Find all starting indices of substrings in a string that are concatenations of a given list of words.

困难
32

最长有效括号

Compute the length of the longest well-formed parentheses substring using state transition dynamic programming and stack…

困难
38

外观数列

Count and Say requires building the nth sequence term by iteratively applying a run-length encoding on strings of digits…

中等
43

字符串相乘

Multiply Strings requires simulating integer multiplication using only string operations without direct numeric conversi…

中等
44

通配符匹配

Implement full wildcard pattern matching using '?' and '*' by applying state transition dynamic programming with careful…

困难
49

字母异位词分组

Group the anagrams in a list of strings using efficient hash table-based methods, focusing on array scanning.

中等
58

最后一个单词的长度

Determine the length of the last word in a string using a focused string-driven approach to handle spaces and trailing c…

简单
65

有效数字

Determine if a given string represents a valid number using precise string parsing and character validation rules.

困难
67

二进制求和

Add Binary involves summing two binary strings and returning the result as a binary string using math and string manipul…

简单
68

文本左右对齐

Text Justification requires packing words into lines to match a specified width, ensuring even distribution of spaces.

困难
71

简化路径

Simplify a Unix-style path by transforming it into its canonical form using stack-based state management.

中等
72

编辑距离

Determine the minimum number of insertions, deletions, or replacements to transform one string into another using dynami…

中等
76

最小覆盖子串

Find the smallest substring of s containing all characters from t using a sliding window with running state updates for …

困难
79

单词搜索

Solve Word Search with backtracking by exploring adjacent cells to match a target word in a grid.

中等
87

扰乱字符串

Scramble String is a dynamic programming problem where we determine if one string can be scrambled to form another using…

困难
91

解码方法

Decode Ways is a dynamic programming problem focused on decoding a numeric string to letters using specific mappings.

中等
93

复原 IP 地址

Restore all valid IP addresses from a string using backtracking with pruning, avoiding invalid segments or leading zeros…

中等
97

交错字符串

The Interleaving String problem requires determining if a string can be formed by interleaving two others, utilizing dyn…

中等
115

不同的子序列

Compute the number of distinct subsequences of one string matching another using precise state transition dynamic progra…

困难
125

验证回文串

Check if a given string is a valid palindrome by using two-pointer scanning and invariant tracking techniques.

简单
126

单词接龙 II

Find all shortest transformation sequences from beginWord to endWord using a dictionary, leveraging backtracking search …

困难
127

单词接龙

Find the shortest transformation sequence from a start word to an end word, with each word in the sequence differing by …

困难
131

分割回文串

Find all possible palindrome partitioning of a string using backtracking and dynamic programming.

中等
132

分割回文串 II

Determine the minimum cuts required to partition a string into all palindromic substrings using dynamic programming tech…

困难
139

单词拆分

Determine if a string can be fully segmented into dictionary words using array scanning and hash-based lookups for effic…

中等
140

单词拆分 II

Given a string and dictionary, return all possible sentences by adding spaces where each word is in the dictionary.

困难
151

反转字符串中的单词

Reverse Words in a String requires reordering words using precise two-pointer scanning with careful space handling for e…

中等
165

比较版本号

Compare two version numbers by checking their individual revisions, considering missing revisions as zero, using a two-p…

中等
166

分数到小数

Convert a fraction into a decimal, handling repeating decimals with parentheses around the repeating part.

中等
168

Excel 表列名称

Convert a positive integer to its corresponding Excel column title using base-26 math and string manipulation efficientl…

简单
171

Excel 表列序号

This problem requires converting an Excel column title into its corresponding column number by applying a math and strin…

简单
179

最大数

The problem asks to arrange integers to form the largest possible number, focusing on greedy algorithms and string handl…

中等
187

重复的DNA序列

Solve Repeated DNA Sequences by sliding a length-10 window and tracking seen patterns with a hash set or bitmask.

中等
205

同构字符串

Determine if two strings are isomorphic by checking if one string can be transformed into the other using character repl…

简单
208

实现 Trie (前缀树)

This problem requires designing a Trie (Prefix Tree) to efficiently store and query strings using hash table concepts fo…

中等
211

添加与搜索单词 - 数据结构设计

Build a WordDictionary supporting dynamic word addition and search with wildcard matching efficiently using Trie and DFS…

中等
212

单词搜索 II

Solve the Word Search II problem using backtracking with pruning to find all words on a board of characters.

困难
214

最短回文串

The Shortest Palindrome problem asks to transform a string into a palindrome by adding characters at the beginning, with…

困难
224

基本计算器

Implement a basic calculator to evaluate mathematical expressions, ensuring correct evaluation with stack-based manageme…

困难
227

基本计算器 II

Basic Calculator II evaluates a mathematical expression with operators and integers, handling basic arithmetic with prec…

中等
241

为运算表达式设计优先级

Solve Different Ways to Add Parentheses by splitting on each operator and memoizing every subexpression result list.

中等
242

有效的字母异位词

Check if two strings are anagrams using hashing or sorting techniques.

简单
257

二叉树的所有路径

Find all root-to-leaf paths in a binary tree using DFS and backtracking, constructing strings for each complete path eff…

简单
273

整数转换英文表示

Convert a given integer to its English words representation using mathematical logic and string manipulation.

困难
282

给表达式添加运算符

Expression Add Operators is solved with backtracking that builds multi-digit operands and tracks multiplication preceden…

困难
290

单词规律

Solve Word Pattern by checking a one-to-one mapping between pattern letters and words using hash tables after splitting …

简单
297

二叉树的序列化与反序列化

This problem asks to serialize and deserialize a binary tree, requiring an efficient approach to handle traversal and st…

困难
299

猜数字游戏

Solve the Bulls and Cows problem using hash tables and string manipulation to track exact and misplaced digits.

中等
301

删除无效的括号

Remove the minimum number of invalid parentheses to generate all possible valid strings efficiently using backtracking a…

困难
306

累加数

Additive Number is solved by trying the first two splits, then pruning aggressively while verifying each required sum in…

中等
316

去除重复字母

Remove duplicate letters from a string to produce the lexicographically smallest result using stack-based state manageme…

中等
318

最大单词长度乘积

The problem requires finding the maximum product of lengths of two words from an array, where the words don't share comm…

中等
331

验证二叉树的前序序列化

Determine if a given string correctly represents a binary tree preorder traversal using state tracking and slot counting…

中等
336

回文对

Find all pairs of words in a list that form palindromes when concatenated using efficient scanning and hash mapping.

困难
344

反转字符串

Reverse a character array in-place using a two-pointer scanning technique, ensuring minimal memory and correct index swa…

简单
345

反转字符串中的元音字母

Reverse Vowels of a String uses a two-pointer approach to reverse the vowels in a string while leaving the consonants in…

简单
383

赎金信

Determine if a ransom note can be constructed from a magazine's letters using hash tables and string counting techniques…

简单
385

迷你语法分析器

Deserialize a nested list string using stack-based state management, handling integers and nested lists with depth-first…

中等
387

字符串中的第一个唯一字符

Find the index of the first non-repeating character in a string using efficient queue-driven state processing.

简单
388

文件的最长绝对路径

Find the length of the longest absolute file path in a filesystem string using stack-based depth tracking efficiently.

中等
389

找不同

Find the Difference involves identifying the additional letter in one string compared to another, emphasizing hash table…

简单
392

判断子序列

Determine if one string is a subsequence of another using state transition dynamic programming for accurate character ma…

简单
394

字符串解码

Decode a nested encoded string using stack-based state management, handling repeated patterns efficiently with recursion…

中等
395

至少有 K 个重复字符的最长子串

Find the length of the longest substring where every character appears at least k times using sliding window and divide-…

中等
399

除法求值

Compute the results of division queries from given equations using graph traversal and depth-first search efficiently.

中等
402

移掉 K 位数字

Remove K Digits requires selecting which digits to drop using a monotonic stack for the smallest possible integer result…

中等
405

数字转换为十六进制数

Convert a 32-bit integer to its hexadecimal string using math operations and careful string manipulation techniques.

简单
409

最长回文串

Determine the length of the longest palindrome constructible from a given string using greedy counting and frequency tra…

简单
412

Fizz Buzz

Generate a list from 1 to n replacing multiples of 3 with Fizz, 5 with Buzz, and both with FizzBuzz efficiently.

简单
415

字符串相加

Given two non-negative integers as strings, sum them and return the result as a string without converting to integers di…

简单
420

强密码检验器

The Strong Password Checker problem challenges you to optimize password strength while minimizing steps using greedy alg…

困难
423

从英文中重建数字

This problem asks you to reconstruct digits from an out-of-order English string using hash counting and mathematical ded…

中等
424

替换后的最长重复字符

Find the length of the longest substring after at most k replacements using a sliding window and character count trackin…

中等
433

最小基因变化

Determine the minimum number of single-character gene mutations to reach the target gene using BFS and a hash table look…

中等
434

字符串中的单词数

Count the segments of non-space characters in a string by applying a string-driven approach to solve the problem.

简单
438

找到字符串中所有字母异位词

Find all starting indices of p's anagrams in s using sliding window and hash table approach.

中等
443

压缩字符串

Compress a character array in-place by converting consecutive repeated characters into counts using two-pointer scanning…

中等
449

序列化和反序列化二叉搜索树

Design an algorithm to serialize and deserialize a binary search tree with efficient traversal and state tracking.

中等
451

根据字符出现频率排序

Sort Characters By Frequency requires counting characters efficiently and rearranging a string in descending frequency o…

中等
459

重复的子字符串

Check if a string can be constructed by repeating a substring using string matching techniques.

简单
466

统计重复个数

This problem requires counting how many times a repeated string s2 fits as a subsequence within a repeated string s1 usi…

困难
467

环绕字符串中唯一的子字符串

Solve the 'Unique Substrings in Wraparound String' problem using dynamic programming with a state transition approach.

中等
468

验证IP地址

Determine whether a given string is a valid IPv4 or IPv6 address using a precise string-driven validation strategy.

中等
472

连接词

Find concatenated words by using dynamic programming and depth-first search to identify valid words made of other words …

困难
474

一和零

Solve the Ones and Zeroes problem using dynamic programming with state transition, focusing on array and string manipula…

中等
481

神奇字符串

Count the number of '1's in the first n characters of a magical string using two-pointer scanning and invariant tracking…

中等
482

密钥格式化

Reformat a license key string by splitting into groups of size k, converting to uppercase, and handling dashes appropria…

简单
488

祖玛游戏

The Zuma Game involves clearing balls from the board using a limited hand, applying dynamic programming and state transi…

困难
500

键盘行

Identify all words from a list that can be typed using letters from only one row of a standard American keyboard.

简单
504

七进制数

Convert any given integer to its base 7 string representation using efficient math and string manipulation techniques.

简单
514

自由之路

Determine the minimum rotations and button presses to spell a keyword on a circular dial using state transition dynamic …

困难
516

最长回文子序列

Find the length of the longest palindromic subsequence in a string using precise state transition dynamic programming.

中等
520

检测大写字母

Detect Capital asks you to determine if a word follows a correct capital usage pattern based on specific rules.

简单
521

最长特殊序列 Ⅰ

Determine the length of the longest uncommon subsequence between two strings using a direct string comparison strategy.

简单
522

最长特殊序列 II

Find the longest string in an array that is not a subsequence of any other string, using array scanning and hash checks …

中等
524

通过删除字母匹配到字典里最长单词

Find the longest word in the dictionary that can be formed by deleting characters from a string, using two-pointer scann…

中等
535

TinyURL 的加密与解密

Design a class that encodes and decodes URLs using a URL shortening approach based on hash tables and strings.

中等
537

复数乘法

This problem requires multiplying two complex numbers, given in string form, and returning the result in the same format…

中等
539

最小时间差

Calculate the smallest time difference between clock points using array manipulation and mathematical conversions effici…

中等
541

反转字符串 II

Reverse String II requires reversing segments of a string using two-pointer scanning while tracking invariants carefully…

简单
551

学生出勤记录 I

Determine if a student's attendance record qualifies for an award based on specific criteria for absences and lateness.

简单
556

下一个更大元素 III

Find the next greater integer using the same digits as a given number with precise two-pointer scanning and invariant tr…

中等
557

反转字符串中的单词 III

Reverse Words in a String III involves reversing each word in a sentence using the two-pointer technique.

简单
564

寻找最近的回文数

Identify the nearest palindrome to a given integer string, handling ties and large numbers efficiently using math and st…

困难
567

字符串的排列

Check if a string contains a permutation of another string using two-pointer scanning and hash table techniques.

中等
583

两个字符串的删除操作

Find the minimum number of steps to make two strings equal by deleting characters, using dynamic programming.

中等
591

标签验证器

The Tag Validator problem involves validating a code snippet by parsing through tags using a stack-based state managemen…

困难
592

分数加减运算

Solve fraction addition and subtraction by handling expressions, calculating results, and simplifying fractions to irred…

中等
599

两个列表的最小索引总和

Find the common strings between two lists with the smallest index sum in this easy problem involving array scanning and …

简单
606

根据二叉树创建字符串

Given a binary tree, construct a string representation based on preorder traversal while adhering to specific formatting…

中等
609

在系统中查找重复文件

Find and return duplicate files in the file system, grouping them by their paths and contents using an array scanning ap…

中等
639

解码方法 II

Decode Ways II is a challenging dynamic programming problem that involves decoding messages with digits and wildcard cha…

困难
640

求解方程

Solve the equation for the variable 'x' and determine its value or state if there is no solution or infinite solutions.

中等
647

回文子串

Count all palindromic substrings in a given string using state transition dynamic programming for efficient evaluation.

中等
648

单词替换

Replace words in a sentence using the shortest root from a dictionary, applying efficient array scanning and hash lookup…

中等
649

Dota2 参议院

The Dota2 Senate problem involves simulating voting rounds between Radiant and Dire senators until one party wins, using…

中等
657

机器人能否返回原点

Judge whether a robot returns to the origin after a sequence of moves using string manipulation and simulation.

简单
664

奇怪的打印机

Calculate the minimum turns a strange printer needs to print any string using state transition dynamic programming effic…

困难
676

实现一个魔法字典

Design a Magic Dictionary to allow searching with one-character modifications, using Hash Table and String techniques.

中等
677

键值映射

Design and implement a data structure that supports efficient insertion and sum queries based on string prefixes.

中等
678

有效的括号字符串

Solve the Valid Parenthesis String problem by leveraging state transition dynamic programming to handle parentheses and …

中等
680

验证回文串 II

Check if a string can become a palindrome by deleting at most one character using two-pointer scanning and invariant tra…

简单
686

重复叠加字符串匹配

Find the minimum number of repetitions of string a to make string b a substring of the repeated string a.

中等
691

贴纸拼词

Determine the minimum number of stickers needed to spell a target word using array scanning and hash lookups for efficie…

困难
692

前K个高频单词

Solve Top K Frequent Words by counting each word, then ordering ties alphabetically so frequency wins before lexicograph…

中等
696

计数二进制子串

Count Binary Substrings solves for the number of valid substrings with equal 0's and 1's, grouped consecutively in a bin…

简单
709

转换成小写字母

The "To Lower Case" problem asks you to convert all uppercase letters in a string to lowercase.

简单
712

两个字符串的最小ASCII删除和

This problem focuses on minimizing the ASCII delete sum for two strings by using dynamic programming to find the lowest …

中等
720

词典中最长的单词

Find the longest word in a dictionary that can be built one character at a time from other words in the dictionary.

中等
721

账户合并

Merge accounts by connecting emails and returning each user's sorted email list using array scanning and hash lookup eff…

中等
722

删除注释

Remove comments from a given C++ program source array, handling line and block comments.

中等
726

原子的数量

Compute the exact count of each atom in a chemical formula using stack-based state management and hashing techniques eff…

困难
730

统计不同回文子序列

Count Different Palindromic Subsequences leverages dynamic programming to count non-empty palindromic subsequences in a …

困难
736

Lisp 语法解析

Parse Lisp expressions using stack-based state management to evaluate variables and operations.

困难
745

前缀和后缀搜索

Design a dictionary to search words by both prefix and suffix using a Trie structure and hash lookups.

困难
748

最短补全词

Find the shortest word that completes the license plate by matching all required letters, considering frequency and case…

简单
752

打开转盘锁

Solve the Open the Lock problem using array scanning plus hash lookup to efficiently find the shortest unlock sequence.

中等
761

特殊的二进制字符串

Solve the Special Binary String problem using string manipulation and recursion, optimizing lexicographical order.

困难
763

划分字母区间

Partition a string into maximal parts so that each letter appears in only one segment, using two-pointer scanning.

中等
767

重构字符串

Reorganize a string so that no two adjacent characters are the same, if possible, using a greedy approach.

中等
770

基本计算器 IV

Simplify mathematical expressions using stack-based state management, handling variables, operators, and polynomial term…

困难
771

宝石与石头

Given two strings, determine how many of the stones you have are also jewels, considering case sensitivity.

简单
777

在 LR 字符串中交换相邻字符

Transform one string into another by swapping adjacent 'L' and 'R' characters in a sequence of moves.

中等
784

字母大小写全排列

Letter Case Permutation involves generating all possible strings by changing the case of each letter in a given string.

中等
791

自定义字符串排序

Sort the string `s` according to a custom order defined by string `order`.

中等
792

匹配子序列的单词数

Given a string s and a list of words, count how many words are subsequences of s using efficient array scanning and hash…

中等
796

旋转字符串

Determine if one string can be rotated into another by repeatedly shifting characters, leveraging string matching techni…

简单
804

唯一摩尔斯密码词

Determine how many unique Morse code transformations can be generated from a list of words using a hash table and array …

简单
806

写字符串需要的行数

Calculate how many lines are needed to write a string given individual letter widths, constrained to 100 pixels per line…

简单
809

情感丰富的文字

Expressive Words challenges you to determine if a word can be transformed into a given string by extending groups of rep…

中等
811

子域名访问计数

The Subdomain Visit Count problem requires counting the visits to all subdomains of a given domain from a list of count-…

中等
816

模糊坐标

Find all valid 2D coordinate possibilities for an ambiguous input string using backtracking and pruning techniques.

中等
819

最常见的单词

Find the most frequent non-banned word in a paragraph, excluding punctuation, using an efficient array scan and hash tab…

简单
820

单词的压缩编码

Find the minimum length of a reference string encoding an array of words using array scanning and hash lookup efficientl…

中等
821

字符的最短距离

Compute the minimum distance from each character in a string to a target character using efficient scanning techniques.

简单
824

山羊拉丁文

Convert a sentence to Goat Latin by transforming each word based on vowel rules and incremental suffixes efficiently.

简单
828

统计子串中的唯一字符

Calculate the sum of unique characters in all substrings of a string using state transition dynamic programming.

困难
830

较大分组的位置

Identify and return intervals of consecutive, large character groups in a string of lowercase letters.

简单
831

隐藏个人信息

This problem requires masking sensitive parts of emails and phone numbers using a precise string-driven strategy efficie…

中等
833

字符串中的查找与替换

This problem challenges you to perform multiple string replacements at specific indices using a pattern involving array …

中等
838

推多米诺

In the "Push Dominoes" problem, you simulate the falling dominoes based on their initial states and determine their fina…

中等
839

相似字符串组

Determine the number of connected groups of similar strings by swapping at most two letters using array scanning and has…

困难
842

将数组拆分成斐波那契序列

This problem challenges you to split a string into a Fibonacci-like sequence using backtracking and pruning.

中等
843

猜猜这个单词

Master the Guess the Word problem by applying array manipulation, match-counting math, and strategic interactive guessin…

困难
844

比较含退格的字符串

Compare two strings after processing backspaces using efficient two-pointer scanning and careful invariant tracking to e…

简单
848

字母移位

Given a string and a shift array, shift the first i+1 letters of the string as specified in the array.

中等
854

相似度为 K 的字符串

K-Similar Strings involves finding the minimal number of swaps to transform one string into another through character sw…

困难
856

括号的分数

Calculate the score of a balanced parentheses string using stack-based state management for an optimal solution.

中等
859

亲密字符串

Determine if two strings can become equal by swapping exactly two letters using a hash table for character tracking.

简单
880

索引处的解码字符串

Decode the string and find the k-th letter efficiently using stack-based state management in this problem.

中等
884

两句话中的不常见单词

Find uncommon words from two sentences by counting word frequencies using hash tables.

简单
890

查找和替换模式

Identify all words matching a given pattern by checking consistent letter mappings using hash tables and array scanning …

中等
893

特殊等价字符串组

Determine the number of special-equivalent string groups using character swaps at even or odd indices efficiently.

中等
899

有序队列

Given a string and integer k, rearrange characters to achieve the lexicographically smallest string using limited rotati…

困难
902

最大为 N 的数字组合

The 'Numbers At Most N Given Digit Set' problem requires calculating how many numbers can be formed using a given digit …

困难
903

DI 序列的有效排列

The problem asks to find the number of valid permutations for a given DI sequence string using dynamic programming and s…

困难
906

超级回文数

Count all super-palindromes in a given numeric range, where each is a palindrome and square of a palindrome.

困难
916

单词子集

Word Subsets is solved by merging words2 into one max-frequency requirement, then scanning words1 against that fixed let…

中等
917

仅仅反转字母

Reverse the characters of a string while skipping non-letter characters using a two-pointer technique.

简单
921

使括号有效的最少添加

Compute the minimum insertions needed to make a parentheses string valid using efficient stack-based state tracking tech…

中等
925

长按键入

Check if a typed string could result from long pressing characters while typing a given name using a two-pointer scan.

简单
926

将字符串翻转到单调递增

Minimize the number of flips needed to make a binary string monotone increasing using dynamic programming.

中等
929

独特的电子邮件地址

Identify the count of unique email addresses by normalizing local names and using hash-based lookups efficiently.

简单
936

戳印序列

Solve Stamping The Sequence with stack-based state management to convert string s to target using stamp efficiently.

困难
937

重新排列日志文件

Reorder Data in Log Files requires sorting letter-logs lexicographically while keeping digit-logs in original order for …

中等
940

不同的子序列 II

Find the number of distinct non-empty subsequences of a string using dynamic programming and state transitions.

困难
942

增减字符串匹配

Reconstruct a permutation from a DI string using two-pointer scanning, carefully tracking the increasing and decreasing …

简单
943

最短超级串

This problem requires constructing the shortest string containing all input words using state transition dynamic program…

困难
944

删列造序

The 'Delete Columns to Make Sorted' problem asks to remove unsorted columns from a string array, ensuring all columns ar…

简单
949

给定数字能组成的最大时间

Given four digits, determine the latest valid 24-hour time possible using each digit exactly once with backtracking.

中等
953

验证外星语词典

Verify if a sequence of words is sorted according to an alien language's custom alphabet order using array scanning and …

简单
955

删列造序 II

Solve the "Delete Columns to Make Sorted II" problem by applying greedy choices and invariant validation to string array…

中等
960

删列造序 III

The problem requires minimizing deletions to ensure all strings are lexicographically sorted. Use dynamic programming fo…

困难
966

元音拼写检查器

Implement a spellchecker that matches queries to a wordlist using exact, case-insensitive, and vowel-error rules efficie…

中等
972

相等的有理数

Given two rational numbers as strings with possible repeating decimals, determine if they represent the same number.

困难
981

基于时间的键值存储

Implement a time-based key-value store that retrieves the latest value at a given timestamp using efficient binary searc…

中等
984

不含 AAA 或 BBB 的字符串

Solve the problem of constructing a string without consecutive 'AAA' or 'BBB' by applying a greedy approach with invaria…

中等
988

从叶结点开始的最小字符串

Determine the lexicographically smallest string from a leaf to root using binary-tree traversal and careful state tracki…

中等
990

等式方程的可满足性

Determine if it's possible to assign values to variables such that all equations are satisfied based on equality and ine…

中等
1002

查找共用字符

Return an array of common characters from all strings in the given list of words, including duplicates.

简单
1003

检查替换后的词是否有效

Determine if a string can be built from repeated 'abc' insertions using stack-based state management, verifying sequence…

中等
1016

子串能表示从 1 到 N 数字的二进制串

Check if binary string contains all integers from 1 to n as substrings, leveraging sliding window and bit manipulation t…

中等
1021

删除最外层的括号

Remove Outermost Parentheses simplifies a valid parentheses string by removing the outermost layers of parentheses in ea…

简单
1023

驼峰式匹配

Camelcase Matching is a medium difficulty problem where you match queries to a given pattern by inserting lowercase lett…

中等
1028

从先序遍历还原二叉树

Recover a binary tree from its preorder traversal string by tracking node depth and reconstructing child relationships e…

困难
1032

字符流

Implement a StreamChecker that detects if any suffix of a character stream matches a given list of words using efficient…

困难
1041

困于环中的机器人

Determine if a robot following a repeated instruction sequence stays within a bounded circle using math and string simul…

中等
1044

最长重复子串

Find the longest duplicated substring in a string using binary search, sliding window, and rolling hash techniques.

困难
1047

删除字符串中的所有相邻重复项

Solve Remove All Adjacent Duplicates In String by simulating deletions with a stack that collapses matching neighbors im…

简单
1048

最长字符串链

Find the longest word chain by scanning arrays and using hash lookups to efficiently track predecessor-successor sequenc…

中等
1061

按字典序排列最小的等效字符串

Determine the lexicographically smallest string by modeling character equivalences with union find efficiently.

中等
1071

字符串的最大公因子

Find the greatest common divisor string between two strings based on the math and string patterns.

简单
1078

Bigram 分词

Extract the third word in every adjacent triple of words matching a given bigram pattern from a text.

简单
1079

活字印刷

Compute all unique non-empty sequences from given letter tiles using backtracking search with pruning efficiently.

中等
1081

不同字符的最小子序列

The Smallest Subsequence of Distinct Characters problem asks you to find the lexicographically smallest subsequence of a…

中等
1092

最短公共超序列

Compute the shortest string containing both given strings as subsequences using state transition dynamic programming eff…

困难
1096

花括号展开 II

Solve Brace Expansion II efficiently by using stack-based state management to generate all unique combinations of nested…

困难
1106

解析布尔表达式

Solve the "Parsing A Boolean Expression" problem by evaluating boolean expressions using stack-based state management, r…

困难
1108

IP 地址无效化

Transform an IPv4 address by replacing each period with '[.]', focusing on a string-driven, direct manipulation approach…

简单
1111

有效括号的嵌套深度

This problem challenges you to compute the maximum nesting depth of two valid parentheses strings using stack-based stat…

中等
1138

字母板上的路径

Find the path to type a target string on an alphabet board using directional moves and the 'hash table plus string' patt…

中等
1143

最长公共子序列

Find the length of the longest common subsequence between two strings using state transition dynamic programming for eff…

中等
1147

段式回文

Solve the "Longest Chunked Palindrome Decomposition" problem by using dynamic programming and string manipulation techni…

困难
1154

一年中的第几天

Calculate the day number of the year based on a given Gregorian calendar date in the format YYYY-MM-DD.

简单
1156

单字符重复子串的最大长度

Find the maximum length of a repeated character substring after swapping two characters using a sliding window approach …

中等
1160

拼写单词

Compute the total length of words that can be fully constructed from given characters using array scanning and hash mapp…

简单
1163

按字典序排在最后的子串

Identify the lexicographically last substring in a string using two-pointer scanning with invariant tracking efficiently…

困难
1169

查询无效交易

Detect invalid transactions by scanning arrays and cross-checking with hash tables for time, amount, and city conflicts …

中等
1170

比较字符串最小字母出现频次

Compare Strings by Frequency of the Smallest Character requires counting minimal character frequencies in words and quer…

中等
1177

构建回文串检测

Given a string and queries, determine if a substring can be rearranged and modified to form a palindrome.

中等
1178

猜字谜

Solve the "Number of Valid Words for Each Puzzle" problem with array scanning and hash lookup to efficiently count valid…

困难
1189

“气球” 的最大数量

Find the maximum number of times the word 'balloon' can be formed from characters of the given string.

简单
1190

反转每对括号间的子串

Reverse all substrings within matched parentheses using a stack-based approach for efficient state tracking and reversal…

中等
1202

交换字符串中的元素

Find the lexicographically smallest string by swapping characters in given pairs of indices.

中等
1208

尽可能使字符串相等

Optimize substring transformations using a binary search approach to maximize the change within a budget.

中等
1209

删除字符串中的所有相邻重复项 II

Remove all adjacent duplicates in the string using stack-based state management with a given threshold k.

中等
1221

分割平衡字符串

Split a string into the maximum number of balanced substrings where each substring has an equal number of 'L' and 'R'.

简单
1233

删除子文件夹

Remove sub-folders in a filesystem by filtering out folders nested inside other folders.

中等
1234

替换子串得到平衡字符串

Determine the minimum substring length to replace in order to balance a string of Q, W, E, and R characters efficiently.

中等
1239

串联字符串的最大长度

Find the maximum length of a concatenated string from an array with all unique characters using backtracking search with…

中等
1247

交换字符使得字符串相同

This problem requires determining the minimum number of swaps to make two strings equal by swapping characters between t…

中等
1249

移除无效的括号

Given a string with parentheses and letters, remove the fewest parentheses to produce any valid balanced string efficien…

中等
1255

得分最高的单词集合

Calculate the highest total score by selecting words from a list using available letters, respecting individual letter s…

困难
1268

搜索推荐系统

Design a search suggestion system that provides the top three lexicographically smallest products matching a search word…

中等
1278

分割回文串 III

Find the minimal character changes to split a string into k palindromes using precise dynamic programming state transiti…

困难
1286

字母组合迭代器

Implement an iterator that generates all combinations of a given length using efficient backtracking with pruning.

中等
1297

子串的最大出现次数

Find the maximum number of occurrences of any valid substring in a given string with specific constraints on letter coun…

中等
1307

口算难题

Check if a verbal arithmetic equation can be solved using a valid digit-letter mapping.

困难
1309

解码字母到整数映射

Decrypt a string using alphabet-to-integer mapping, considering the presence of '#' as a special delimiter.

简单
1312

让字符串成为回文串的最少插入次数

The problem asks to find the minimum number of insertions to convert a string into a palindrome using dynamic programmin…

困难
1316

不同的循环子字符串

Count the distinct non-empty substrings of a given string that can be formed as the concatenation of a string with itsel…

困难
1320

二指输入的的最小距离

Calculate the minimum total distance to type a word using two fingers on a keyboard, applying dynamic programming.

困难
1324

竖直打印单词

Transform a string into vertical columns by arranging each word character in array positions while trimming trailing spa…

中等
1328

破坏回文串

Given a palindrome, change exactly one character to make it non-palindromic and lexicographically smallest using a greed…

中等
1332

删除回文子序列

This problem challenges you to remove palindromic subsequences from a string with a minimum number of steps using two-po…

简单
1347

制造字母异位词的最小步骤数

Calculate the minimum steps to transform one string into an anagram of another using character replacements efficiently.

中等
1358

包含所有三种字符的子字符串数目

Count all substrings containing at least one of each character a, b, and c using a sliding window approach efficiently.

中等
1360

日期之间隔几天

Calculate the exact number of days between two dates using string parsing and arithmetic logic with consistent accuracy.

简单
1366

通过投票对团队排名

Rank Teams by Votes requires counting position-based votes and resolving ties with array scanning and hash lookup techni…

中等
1370

上升下降字符串

Reorder the string based on a specific algorithm using hash tables and string manipulation.

简单
1371

每个元音包含偶数次的最长子字符串

Find the longest substring with even counts of vowels using bitmasking and hash tables.

中等
1374

生成每种字符都是奇数个的字符串

Generate a string of n characters where each character appears an odd number of times, using a string-driven approach.

简单
1392

最长快乐前缀

Find the longest non-empty prefix of a string that also appears as its suffix, optimizing with rolling hash techniques.

困难
1396

设计地铁系统

Design an underground system to calculate travel times between stations using hash tables for efficient lookups and aver…

中等
1397

找到所有好字符串

Find all good strings between two given strings without including a specified evil substring using dynamic programming.

困难
1400

构造 K 个回文字符串

Determine if a string's characters can be rearranged to form exactly k non-empty palindrome strings using greedy validat…

中等
1404

将二进制表示减到 1 的步骤数

Determine the number of steps to reduce a binary representation of a number to 1 by following specific rules.

中等
1405

最长快乐字符串

Solve the "Longest Happy String" problem using a greedy approach with validation of invariants for constructing the long…

中等
1408

数组中的字符串匹配

Identify all strings in an array that appear as substrings of other strings, focusing on array and string matching patte…

简单
1410

HTML 实体解析器

Transform a string containing HTML entities into their character equivalents using a hash table for efficient parsing.

中等
1415

长度为 n 的开心字符串中字典序第 k 小的字符串

Given n and k, find the k-th lexicographical happy string of length n using backtracking search with pruning.

中等
1416

恢复数组

Calculate the number of arrays that can be restored from a string of digits where each number is within [1, k].

困难
1417

重新格式化字符串

Reformat The String involves rearranging alphanumeric characters in a string so that no adjacent characters have the sam…

简单
1418

点菜展示表

Generate a restaurant display table from orders by counting each food item per table using array scanning and hash looku…

中等
1419

数青蛙

Determine the minimum number of frogs required to sequentially produce all croaks in a mixed frog croak string efficient…

中等
1422

分割字符串的最大得分

Find the optimal split point in a binary string to maximize zeros on the left and ones on the right efficiently.

简单
1433

检查一个字符串是否可以打破另一个字符串

This problem checks whether one string can break another using permutations and a greedy approach for comparison.

中等
1436

旅行终点站

Find the destination city from a list of paths where each path connects two cities. The city with no outgoing path is th…

简单
1446

连续字符

Find the power of a string by determining the length of its longest substring with a unique character.

简单
1447

最简分数

Generate simplified fractions between 0 and 1 with denominators up to a given integer n.

中等
1451

重新排列句子中的单词

Rearrange words in a sentence by their length, maintaining original order for words of equal size for consistent output.

中等
1452

收藏清单

Identify people whose favorite companies lists are unique and not subsets of any other person's list using efficient arr…

中等
1455

检查单词是否为句中其他单词的前缀

Determine the first word in a sentence where a given searchWord is a prefix using two-pointer scanning with string match…

简单
1456

定长子串中元音的最大数目

Find the maximum number of vowels in a substring of a given length in a string using a sliding window approach.

中等
1461

检查一个字符串是否包含所有长度为 K 的二进制子串

Determine if every possible binary string of length k exists as a substring within a given binary string s efficiently u…

中等
1487

保证文件名唯一

This problem requires creating unique folder names by appending suffixes to duplicate names using an array scanning and …

中等
1496

判断路径是否相交

Check if a path crosses itself on a 2D plane using a hash table to track visited points during traversal.

简单
1505

最多 K 次交换相邻数位后得到的最小整数

Reorder digits using at most k adjacent swaps to produce the smallest possible integer, leveraging greedy selection effi…

困难
1507

转变日期格式

Reformat Date requires transforming a date string from human-readable form to YYYY-MM-DD using a string-driven strategy …

简单
1513

仅含 1 的子串数

Calculate the number of contiguous substrings containing only 1s in a binary string using a math and string approach eff…

中等
1520

最多的不重叠子字符串

Find the maximum number of non-overlapping substrings in a given string, ensuring no two substrings intersect unless one…

困难
1525

字符串的好分割数目

Count all valid splits of a string where left and right substrings have equal distinct characters, using efficient state…

中等
1528

重新排列字符串

Reorder characters in a string using a given indices array to reconstruct the intended output efficiently and correctly.

简单
1529

最少的后缀翻转次数

Find the minimum number of operations to convert a binary string to a target string using bit flips.

中等
1531

压缩字符串 II

Solve String Compression II with dynamic programming that tracks deletions, run boundaries, and digit-length jumps in co…

困难
1540

K 次操作转变字符串

Determine if string s can be transformed into t within k moves using character shifts and hash table counting efficientl…

中等
1541

平衡括号字符串的最少插入次数

Compute the minimum insertions to transform a parentheses string into a balanced string using efficient stack tracking.

中等
1542

找出最长的超赞子字符串

Find the maximum-length awesome substring in a numeric string using hash table and bit manipulation for palindrome poten…

困难
1544

整理字符串

This problem requires removing adjacent characters that cancel each other out, leveraging stack-based state management.

简单
1545

找出第 N 个二进制字符串中的第 K 位

Determine the k-th bit in the n-th binary string using a recursive construction that inverts and reverses previous strin…

中等
1556

千位分隔数

Convert a given integer into a string with dots as thousand separators using a precise string-driven strategy.

简单
1573

分割字符串的方案数

Count the number of ways to split a binary string into three non-empty parts with equal numbers of '1's.

中等
1576

替换所有的问号

Solve LeetCode 1576 by scanning left to right and replacing each ? with a letter different from its neighbors.

简单
1578

使绳子变成彩色的最短时间

Minimize the time Bob needs to remove balloons to make a rope colorful using dynamic programming with state transitions.

中等
1585

检查字符串是否可以通过排序子字符串得到另一个字符串

This problem requires checking if string 's' can be transformed into string 't' using substring sort operations.

困难
1592

重新排列单词间的空格

Rearrange spaces between words by distributing them evenly, placing any leftover spaces at the end to match original tex…

简单
1593

拆分字符串使唯一子字符串的数目最大

Maximize unique substrings in a string using backtracking with pruning and hash tables to track substrings.

中等
1598

文件夹操作日志搜集器

Simulate folder navigation based on a list of operations to determine the current folder depth.

简单
1604

警告一小时内使用相同员工卡大于等于三次的人

Solve LeetCode 1604 by grouping swipe times per employee, sorting each list, and scanning for any three within 60 minute…

中等
1614

括号的最大嵌套深度

Find the maximum nesting depth of parentheses in a valid string using stack-based state management.

简单
1616

分割两个字符串得到回文串

Determine if splitting two equal-length strings at a common index can form a palindrome using two-pointer scanning techn…

中等
1624

两个相同字符之间的最长子字符串

Find the longest substring between two equal characters using a hash table for optimized performance.

简单
1625

执行操作后字典序最小的字符串

Optimize a string through rotations and additions to get the lexicographically smallest possible result using string man…

中等
1629

按键持续时间最长的键

Determine which key had the longest press duration in a sequence using array indices and string mapping, resolving ties …

简单
1638

统计只差一个字符的子串数目

Count all substrings from s that differ by exactly one character from some substring in t using precise substring compar…

中等
1639

通过给定词典构造目标字符串的方案数

Calculate the number of ways to form a target string using words of equal length via state transition dynamic programmin…

困难
1647

字符频次唯一的最小删除次数

Determine the minimum deletions needed to ensure all character frequencies in a string are unique using a greedy approac…

中等
1653

使字符串平衡的最少删除次数

Determine the minimum number of deletions to transform a string of 'a' and 'b' into a balanced order using DP.

中等
1657

确定两个字符串是否接近

Check if two strings can transform into each other using letter swaps and frequency reorganizations, leveraging hash tab…

中等
1662

检查两个字符串数组是否相等

Determine if two string arrays form identical strings by concatenating elements in order, handling subtle array-length m…

简单
1663

具有给定数值的最小字符串

Find the lexicographically smallest string of length n with a given numeric value k using a greedy approach.

中等
1668

最大重复子字符串

Find the maximum number of times a given word repeats consecutively in a string using state transition dynamic programmi…

简单
1678

设计 Goal 解析器

Interpret the Goal Parser's output by analyzing a command string containing 'G', '()', and '(al)' patterns.

简单
1684

统计一致字符串的数目

Count the number of strings fully composed of allowed characters using array scanning and hash lookup for efficiency.

简单
1689

十-二进制数的最少数目

This problem asks to find the minimum number of deci-binary numbers needed to sum to a given number represented as a str…

中等
1694

重新格式化电话号码

Reformat a phone number by removing spaces and dashes, grouping digits into blocks of 3 or 2, and joining them with dash…

简单
1702

修改后的最大二进制字符串

The problem asks to maximize a binary string using specific operations to get the highest possible value.

中等
1704

判断字符串的两半是否相似

Check if two halves of a string contain the same number of vowels using a character counting approach efficiently.

简单
1717

删除子字符串的最大得分

Compute the highest score by greedily removing specific substrings using a stack to track state transitions efficiently.

中等
1736

替换隐藏数字得到的最晚时间

Determine the latest valid time by replacing hidden digits using a greedy choice and invariant validation strategy effic…

简单
1737

满足三条件之一需改变的最少字符数

This problem asks for the minimum operations to change two strings so that one of three conditions is met.

中等
1745

分割回文串 IV

The Palindrome Partitioning IV problem asks you to determine if a string can be split into three palindromic substrings.

困难
1750

删除字符串两端相同字符后的最短长度

Minimize string length by deleting similar characters from both ends repeatedly using a two-pointer technique.

中等
1754

构造字典序最大的合并字符串

Construct the lexicographically largest merge from two strings using a two-pointer greedy scanning approach efficiently.

中等
1758

生成交替二进制字符串的最少操作数

Find the minimum number of changes required to convert a string into an alternating binary string.

简单
1759

统计同质子字符串的数目

This problem requires counting all homogenous substrings in a given string and returning the result modulo 10^9 + 7.

中等
1763

最长的美好子字符串

Find the longest nice substring in a given string using the sliding window technique with running state updates.

简单
1768

交替合并字符串

Merge two strings alternately, starting with the first string, and append extra characters when one string is longer.

简单
1769

移动所有球到每个盒子所需的最小操作数

Solve the problem of finding the minimum operations to move balls to each box using an efficient approach with arrays an…

中等
1771

由子序列构造的最长回文串的长度

Maximize Palindrome Length From Subsequences explores dynamic programming to construct the longest palindrome from two s…

困难
1773

统计匹配检索规则的物品数量

Count Items Matching a Rule is an easy problem that tests array and string manipulation with conditions based on specifi…

简单
1781

所有子字符串美丽值之和

Calculate the total beauty of all substrings by counting character frequencies and computing frequency differences effic…

中等
1784

检查二进制字符串字段

Check if a binary string contains at most one contiguous segment of ones.

简单
1790

仅执行一次字符串交换能否使两个字符串相等

Check if one string swap can make two equal strings using hash table and string counting methods.

简单
1796

字符串中第二大的数字

Given a string with alphanumeric characters, find the second largest digit, or return -1 if it doesn’t exist.

简单
1805

字符串中不同整数的数目

Count all unique integers in a string by replacing letters and handling leading zeros correctly with a hash table approa…

简单
1807

替换字符串中的括号内容

Quickly evaluate a string with bracketed keys using array scanning and hash table lookups for efficient replacements.

中等
1812

判断国际象棋棋盘中一个格子的颜色

Determine whether a given chessboard square is white or black by converting coordinates using a math plus string approac…

简单
1813

句子相似性 III

Sentence Similarity III asks if one sentence can be transformed into another by inserting a sentence inside it.

中等
1816

截断句子

Truncate a sentence to contain only the first k words by converting it into an array of words.

简单
1830

使字符串有序的最少操作次数

Calculate the minimum operations to sort a string using combinatorial math and string manipulation techniques efficientl…

困难
1832

判断句子是否为全字母句

Determine if a given lowercase string contains every English letter using efficient hash table tracking techniques.

简单
1839

所有元音按顺序排布的最长子字符串

Find the longest substring of all vowels in order within a given string of vowels using sliding window technique.

中等
1844

将所有数字用字符替换

Transform a string by replacing digits at odd indices using the preceding character with a shift operation for accurate …

简单
1849

将字符串拆分为递减的连续值

Check if a string of digits can be split into descending consecutive values where the difference between them is 1.

中等
1850

邻位交换的最小次数

Find the minimum number of adjacent swaps to reach the kth smallest wonderful integer from a given number string.

中等
1859

将句子排序

Reconstruct a shuffled sentence by sorting words using their embedded indices to restore the original sentence order eff…

简单
1864

构成交替字符串需要的最小交换次数

This problem requires finding the minimum number of swaps to make a binary string alternating or determine if it's impos…

中等
1869

哪种连续子字符串更长

Determine if the longest segment of 1s in a binary string is strictly longer than the longest segment of 0s.

简单
1871

跳跃游戏 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…

中等
1876

长度为三且各字符不同的子字符串

Count all substrings of length three in a string where each character is unique using sliding window techniques efficien…

简单
1880

检查某单词是否等于两单词之和

Check if the sum of two word values equals a target word's value by converting letters to their numeric representations.

简单
1881

插入后的最大值

Solve Maximum Value after Insertion by greedily placing x at the first digit that makes the resulting signed number larg…

中等
1888

使二进制字符串字符交替的最少反转次数

Find the minimum number of flips to make a binary string alternate, using state transition dynamic programming.

中等
1896

反转表达式值的最少操作次数

Determine the minimum operations to change a boolean expression's result using state transition dynamic programming effi…

困难
1897

重新分配字符使所有字符串都相等

Determine if you can redistribute characters among strings so that all strings become identical using a counting approac…

简单
1898

可移除字符的最大数目

Use binary search and a subsequence check to find the largest removable prefix that still keeps p inside s.

中等
1903

字符串中的最大奇数

Find the largest odd number in a string using a greedy approach with careful digit inspection and invariant checks.

简单
1904

你完成的完整对局数

Solve this math plus string problem to calculate the number of full rounds played in a chess tournament between login an…

中等
1910

删除一个字符串中所有出现的给定子字符串

Remove all occurrences of a specified substring from a string using efficient stack-based state management.

中等
1915

最美子字符串的数目

Count the number of wonderful non-empty substrings of a given string based on frequency conditions of characters.

中等
1927

求和游戏

Determine if Alice can force a win in the Sum Game by strategically replacing '?' using a greedy and invariant approach.

中等
1930

长度为 3 的不同回文子序列

Count all unique length-3 palindromic subsequences in a string efficiently using hash tables and character positions.

中等
1935

可以输入的最大单词数

Determine how many words can be typed on a malfunctioning keyboard with some broken keys.

简单
1941

检查是否所有字符出现次数相同

Check if a string has characters with equal occurrences using hash tables and string manipulation techniques.

简单
1945

字符串转化后的各位数字之和

Convert a lowercase string into digits and repeatedly sum them k times using a direct string plus simulation approach.

简单
1946

子字符串突变后可能得到的最大整数

Find the largest integer by mutating a substring of a number using a mapping array for each digit.

中等
1948

删除系统中的重复文件夹

Solve Delete Duplicate Folders in System by building a trie, serializing child subtrees, and deleting repeated non-empty…

困难
1957

删除字符使字符串变好

This problem asks to remove the minimum number of characters from a string to ensure no three consecutive characters are…

简单
1960

两个回文子字符串长度的最大乘积

Find the maximum product of lengths of two non-overlapping odd-length palindromic substrings using string and rolling ha…

困难
1961

检查字符串是否为数组前缀

Determine if a string is a prefix of an array by concatenating initial elements, using two-pointer scanning efficiently.

简单
1963

使字符串平衡的最小交换次数

Determine the minimum swaps to balance a bracket string using two-pointer scanning with invariant tracking efficiently.

中等
1967

作为子字符串出现在单词中的字符串数目

Count how many strings in an array appear as substrings within a given word by checking each pattern individually.

简单
1974

使用特殊打字机键入单词的最少时间

Compute the minimum typing time by greedily taking the shorter circular move between consecutive letters, then adding on…

简单
1977

划分数字的方案数

Calculate the number of valid non-decreasing integer sequences from a string using state transition dynamic programming …

困难
1980

找出不同的二进制字符串

Find a binary string of length n not in the input array using array scanning and hash lookup efficiently.

中等
1985

找出数组中的第 K 大整数

This problem asks to find the kth largest integer in an array of string numbers, highlighting sorting and string-based c…

中等
1987

不同的好子序列数目

Find the number of unique good subsequences of a binary string using dynamic programming and modular arithmetic.

困难
2000

反转单词前缀

Reverse the prefix of a string starting from index 0 to the first occurrence of a given character.

简单
2002

两个回文子序列长度的最大乘积

Find two disjoint palindromic subsequences in a string to maximize the product of their lengths efficiently using dynami…

中等
2011

执行操作后的变量值

Compute the final value of X by simulating each string operation in the array sequentially with careful tracking.

简单
2014

重复 K 次的最长子序列

Find the longest subsequence repeated k times in a string using backtracking search with pruning.

困难
2019

解出数学表达式的学生分数

Calculate student scores for a single-digit math expression using state transition dynamic programming to track all vali…

困难
2023

连接后等于目标字符串的字符串对

Count all unique index pairs in a string array whose concatenation exactly matches the given target string using efficie…

中等
2024

考试的最大困扰度

Maximize the Confusion of an Exam requires adjusting at most k answers to create the longest consecutive true or false s…

中等
2027

转换字符串的最少操作次数

Minimize moves to convert a string of 'X' and 'O' to all 'O' by converting three consecutive characters to 'O'.

简单
2030

含特定字母的最小子序列

Find the lexicographically smallest subsequence of length k with at least repetition occurrences of a given letter using…

困难
2038

如果相邻两个颜色均相同则删除当前颜色

Alice and Bob play a game removing colored pieces; Alice wins if she makes the last valid move.

中等
2042

检查句子中的数字是否递增

Check if the numbers in a sentence are strictly increasing from left to right using string tokenization.

简单
2047

句子中的有效单词数

Count all valid words in a sentence by analyzing each token with precise string-driven validation rules efficiently.

简单
2053

数组中第 K 个独一无二的字符串

Find the kth distinct string in an array by identifying strings that appear only once, using efficient array scanning an…

简单
2055

蜡烛之间的盘子

Determine the number of plates between candles in a given substring using binary search and prefix sum techniques.

中等
2056

棋盘上有效移动组合的数目

Given a set of pieces on a chessboard, calculate the number of valid move combinations without overlap using backtrackin…

困难
2060

同源字符串检测

Determine if there exists an original string that could produce both encoded inputs using state transition dynamic progr…

困难
2062

统计字符串中的元音子字符串

Count the number of vowel substrings that include all five vowels in a string.

简单
2063

所有子字符串中的元音

Compute the total number of vowels in all substrings of a given string using efficient state transition dynamic programm…

中等
2068

检查两个字符串是否几乎相等

Solve Check Whether Two Strings are Almost Equivalent by counting letters and rejecting any character whose frequency ga…

简单
2075

解码斜向换位密码

Decode the Slanted Ciphertext problem requires decoding a slanted cipher using string manipulation and simulation based …

中等
2085

统计出现过一次的公共字符串

Learn how to efficiently count strings appearing exactly once in both arrays using array scanning and hash lookup patter…

简单
2086

喂食仓鼠的最小食物桶数

Find the minimum number of food buckets required to feed all hamsters, using dynamic programming and greedy techniques.

中等
2096

从二叉树一个节点到另一个节点每一步的方向

Find the shortest path between two nodes in a binary tree and output the directions as a string of 'L', 'R', and 'U'.

中等
2103

环和杆

Count how many rods have all three colors using a hash table to track colors per rod efficiently in strings.

简单
2108

找出数组中的第一个回文字符串

Return the first palindromic string from an array of words or an empty string if none exists.

简单
2109

向字符串添加空格

Learn to efficiently insert spaces in a string using two-pointer scanning with invariant tracking in linear time.

中等
2114

句子中的最多单词数

Find the maximum number of words in a single sentence from an array of sentences using array and string processing techn…

简单
2115

从给定原材料中找到所有可以做出的菜

Determine all recipes you can prepare given initial supplies and ingredient dependencies, leveraging array scanning and …

中等
2116

判断一个括号字符串是否有效

Determine if a parentheses string can be transformed into a valid sequence considering locked positions using stack logi…

中等
2120

执行所有后缀指令

Simulate robot moves from every instruction index on an n x n grid, counting valid steps without leaving boundaries.

中等
2124

检查是否所有 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…

简单
2125

银行中的激光束数量

Calculate total laser beams in a bank floor plan using array counting and math logic between security devices on differe…

中等
2129

将标题首字母大写

Capitalize the Title requires transforming each word based on length, applying uppercase and lowercase rules precisely p…

简单
2131

连接两字母单词得到的最长回文串

Find the maximum-length palindrome by combining two-letter words using array scanning and hash table lookups efficiently…

中等
2135

统计追加字母可以获得的单词数

Given startWords and targetWords, check how many targetWords can be formed by adding one letter and rearranging letters …

中等
2138

将字符串拆分为若干长度为 k 的组

Divide a string into equal groups of size k, using a fill character to complete the last group if needed.

简单
2147

分隔长廊的方案数

Calculate the number of ways to split a corridor into sections with exactly two seats using dynamic programming efficien…

困难
2156

查找给定哈希值的子串

Locate the first substring of length k whose rolling hash matches the given hashValue using a sliding window approach.

困难
2157

字符串分组

Group words into connected sets using operations on characters with string and bit manipulation techniques.

困难
2166

设计位集

Master the Design Bitset problem by efficiently managing bit flips, counts, and indexed updates with array and hash look…

中等
2167

移除所有载有违禁货物车厢所需的最少时间

Determine the minimum time to remove all cars with illegal goods using state transition dynamic programming efficiently.

困难
2182

构造限制重复的字符串

Construct a lexicographically largest string from a given string with no letter appearing more than a repeatLimit times …

中等
2185

统计包含给定前缀的字符串

Count how many words in a list start with a given prefix.

简单
2186

制造字母异位词的最小步骤数 II

Compute the fewest character insertions needed to turn two strings into anagrams using hash table frequency counts effic…

中等
2193

得到回文串的最少操作次数

The problem challenges you to find the minimum number of adjacent swaps to make a string a palindrome.

困难
2194

Excel 表中某个范围内的单元格

This problem requires extracting a range of cells from an Excel-like sheet based on a string input and returning them in…

简单
2207

字符串中最多数目的子序列

Maximize the number of subsequences by optimally adding a character to a given string to match a specified pattern.

中等
2209

用地毯覆盖后的最少白色砖块

Find the minimum number of white tiles visible after optimally placing carpets using state transition dynamic programmin…

困难
2211

统计道路上的碰撞次数

Count Collisions on a Road is a problem where you calculate the number of car collisions based on their movements in a s…

中等
2213

由单个字符重复的最长子字符串

Solve Longest Substring of One Repeating Character by maintaining mergeable run information under character updates afte…

困难
2222

选择建筑的方案数

Solve Number of Ways to Select Buildings by counting alternating 3-building patterns with state transitions over the bin…

中等
2223

构造字符串的总得分和

Calculate the sum of scores of built strings by analyzing longest common prefixes with suffixes in a string using effici…

困难
2224

转化时间需要的最少操作数

The problem asks to find the minimum number of operations to convert one time string to another using specific time incr…

简单
2227

加密解密字符串

The 'Encrypt and Decrypt Strings' problem involves creating a data structure that can encrypt and decrypt strings using …

困难
2232

向表达式添加括号后的最小结果

Enumerate every valid parenthesis placement around the plus sign and choose the expression with the smallest evaluated p…

中等
2243

计算字符串的数字和

Learn how to repeatedly sum digit groups in a string until its length is at most k using string simulation techniques.

简单
2246

相邻字符不同的最长路径

Find the longest path in a tree where adjacent nodes have different characters using graph DFS and topological reasoning…

困难
2255

统计是给定字符串前缀的字符串数目

Count Prefixes of a Given String is a problem that involves finding the number of string prefixes in an array that match…

简单
2259

移除指定数字得到的最大结果

Determine the largest possible number by removing one specific digit using a greedy approach and string iteration.

简单
2262

字符串的总引力

Calculate the total appeal of all substrings by counting distinct characters efficiently using state transition DP and h…

困难
2264

字符串中最大的 3 位相同数字

Find the largest 3-same-digit number within a string of digits using a string-driven solution approach.

简单
2266

统计打字方案数

Calculate the total number of possible original texts from a pressed key sequence using state transition dynamic program…

中等
2269

找到一个数字的 K 美丽值

Calculate the k-beauty of a number by counting substrings of length k that divide the original number evenly using a sli…

简单
2273

移除字母异位词后的结果数组

This problem requires removing adjacent anagrams from a list of words using an array scanning and hash lookup approach.

简单
2278

字母在字符串中的百分比

Calculate the percentage of a specific letter in a string using a direct string-driven counting approach, rounding down …

简单
2283

判断一个数的数字计数是否等于数位的值

Determine if a number's digits correspond to their counts in the string representation.

简单
2284

最多单词数的发件人

Find the sender with the largest total word count by scanning messages and tallying counts using a hash table efficientl…

中等
2287

重排字符形成目标字符串

Calculate the maximum copies of a target string from letters in s using frequency counting and hash tables efficiently.

简单
2288

价格减免

Apply Discount to Prices involves updating a sentence by applying a percentage discount to price words, with precise for…

中等
2296

设计一个文本编辑器

Design a text editor that supports text manipulation and cursor navigation operations efficiently with linked-list-based…

困难
2299

强密码检验器 II

Check if a given password meets all strength requirements, including length, character types, and no adjacent repeated c…

简单
2301

替换字符后匹配

Determine if a target substring can appear in a string after optional character replacements using given mappings effici…

困难
2306

公司命名

The "Naming a Company" problem requires determining the number of valid distinct company names from a list of name ideas…

困难
2309

兼具大小写的最好英文字母

Find the greatest English letter that exists in both lowercase and uppercase in a string using a hash table approach.

简单
2311

小于等于 K 的最长二进制子序列

Find the longest subsequence in a binary string that forms a number less than or equal to a given integer k.

中等
2315

统计星号

The 'Count Asterisks' problem asks you to count '*' excluding those between pairs of '|' in a string.

简单
2325

解密消息

Decode the Message is an easy problem involving hash table mapping for string decoding based on a cipher key.

简单
2337

移动片段得到字符串

Determine if the pieces in start can be moved to form target using two-pointer scanning and strict left-right movement r…

中等
2343

裁剪数字后查询第 K 小的数字

Solve the Query Kth Smallest Trimmed Number problem by efficiently trimming and sorting strings in an array to answer qu…

中等
2351

第一个出现两次的字母

Find the first letter that repeats in a string using hash table tracking and early detection for efficiency.

简单
2353

设计食物评分系统

Design a food rating system that tracks and updates ratings of foods, finding the highest rated items by cuisine.

中等
2370

最长理想子序列

The Longest Ideal Subsequence problem involves finding the longest subsequence where each character has a difference of …

中等
2375

根据模式串构造最小数字

Construct the lexicographically smallest string that fits the increasing and decreasing conditions of a given pattern.

中等
2379

得到 K 个黑块的最少涂色次数

Given a string of blocks, determine the minimum number of recolors needed to get k consecutive black blocks.

简单
2380

二进制字符串重新安排顺序需要的时间

Calculate the exact seconds required to convert all 01 pairs into 10 in a binary string using state transitions.

中等
2381

字母移位 II

Shift letters in a string using a sequence of range-based forward or backward operations efficiently with prefix sums.

中等
2384

最大回文数字

Form the largest palindromic number from a string of digits while maintaining a valid palindrome structure.

中等
2390

从字符串中移除星号

Remove all stars from a string by simulating the removal process using a stack to manage characters and stars efficientl…

中等
2391

收集垃圾的最少总时间

This problem asks you to find the minimum amount of time needed to collect all garbage in a city, focusing on array and …

中等
2399

检查相同字母间的距离

Verify if each pair of identical letters in a string has the exact number of letters between them as specified in a dist…

简单
2405

子字符串的最优划分

Given a string s, partition it into substrings with unique characters and return the minimum number of substrings.

中等
2409

统计共同度过的日子数

Count the total number of days Alice and Bob are in Rome together, given their arrival and departure dates.

简单
2414

最长的字母序连续子字符串的长度

Find the length of the longest continuous alphabetical substring from a given string of lowercase letters.

中等
2416

字符串的前缀分数和

The 'Sum of Prefix Scores of Strings' problem involves calculating prefix scores for strings based on their occurrences …

困难
2418

按身高排序

Sort the People requires pairing names with heights and sorting them in descending height order efficiently using arrays…

简单
2423

删除字符使频率相同

Determine if removing a single letter from a string can make all remaining letters have identical frequency efficiently.

简单
2430

对字母串可执行的最大删除数

Find the maximum number of deletions on a string using state transition dynamic programming and rolling hash techniques …

困难
2434

使用机器人打印字典序最小的字符串

Solve the problem of using a robot to print the lexicographically smallest string with stack-based state management.

中等
2437

有效时间的数目

Calculate how many valid digital clock times can be formed by replacing unknown digits in a string format hh:mm.

简单
2446

判断两个事件是否存在冲突

Compare two same-day time intervals and check whether their inclusive endpoints overlap after converting HH:MM strings i…

简单
2451

差值数组不同的字符串

Identify the one string in an array whose consecutive letter differences deviate from all others using array scanning pl…

简单
2452

距离字典两次编辑以内的单词

Identify all words in queries that can match dictionary entries with at most two character changes efficiently using arr…

中等
2456

最流行的视频创作者

Identify the most popular video creator by summing views and selecting their top-viewed video with array and hash patter…

中等
2468

根据限制分割消息

Split Message Based on Limit requires dividing a string into parts with length constraints using a calculated suffix pat…

困难
2472

不重叠回文子字符串的最大数目

Find the maximum number of non-overlapping palindromic substrings of at least length k in a string using dynamic program…

困难
2478

完美分割的方案数

The problem involves finding the number of beautiful partitions in a string with dynamic programming and state transitio…

困难
2483

商店的最少代价

Determine the earliest closing hour of a shop to minimize penalty using a string of customer visits and prefix sums.

中等
2484

统计回文子序列数目

Count the number of palindromic subsequences of length 5 in a given string of digits.

困难
2486

追加字符以获得子序列

Determine the minimum characters to append to s so t becomes a subsequence using efficient two-pointer scanning techniqu…

中等
2490

回环句

Determine if a sentence is circular by verifying each word's last character matches the next word's first character effi…

简单
2496

数组中字符串的最大值

The problem requires finding the maximum value of alphanumeric strings in an array based on length or numeric value.

简单
2506

统计相似字符串对的数目

Count similar string pairs by converting each word into a character-set signature and counting matching signatures effic…

简单
2512

奖励最顶尖的 K 名学生

Calculate top K student scores by scanning reports and using hash tables for positive and negative word lookups efficien…

中等
2514

统计同位异构字符串数目

Learn to count distinct anagrams for a multi-word string using hash tables, math, and combinatorics efficiently.

困难
2515

到目标字符串的最短距离

Find the shortest distance to a target string in a circular array with either left or right movement options.

简单
2516

每种字符至少取 K 个

Find the minimum number of minutes needed to take at least k of each character from both ends of a string.

中等
2522

将字符串分割成值不超过 K 的子字符串

Determine the minimum number of substrings from a numeric string such that each substring value does not exceed k using …

中等
2531

使字符串中不同字符的数目相等

Determine if a single swap can equalize distinct character counts between two strings using hash tables for tracking fre…

中等
2546

执行逐位运算使字符串相等

Determine if a binary string s can be transformed into target using repeated bitwise operations on paired indices effici…

中等
2559

统计范围内的元音字符串数

Count the number of strings that start and end with a vowel in given ranges within an array of words.

中等
2564

子字符串异或查询

Solve the Substring XOR Queries problem using array scanning and hash lookup to efficiently handle multiple queries on b…

中等
2565

最少得分子序列

Find the minimum score of a string by removing characters from t while maintaining subsequence validity with s.

困难
2573

找出对应 LCP 矩阵的字符串

Determine the lexicographically smallest string matching a given LCP matrix using state transition dynamic programming.

困难
2575

找出字符串的可整除数组

Calculate the divisibility array for a string by checking if prefixes are divisible by a given number.

中等
2586

统计范围内的元音字符串数

Count the Number of Vowel Strings in Range asks to count vowel strings in a subarray of a given word list.

简单
2606

找到最大开销的子字符串

Find the Substring With Maximum Cost requires calculating substring values using a hash lookup for character costs, with…

中等
2609

最长平衡子字符串

Find the longest balanced substring of a binary string where zeroes precede ones and counts of each are equal.

简单
2645

构造有效字符串的最少插入数

Determine the minimum insertions required to transform a given string into repeated concatenations of 'abc' using dynami…

中等
2663

字典序最小的美丽字符串

Find the lexicographically smallest beautiful string larger than the given string using greedy choice and invariant vali…

困难
2678

老人的数目

Determine how many passengers are over 60 years old based on their compressed details in an array of strings.

简单
2696

删除子串后的字符串最小长度

Determine the smallest string length after repeatedly removing AB or CD substrings using stack-based simulation techniqu…

简单
2697

字典序最小回文串

Given a string, make it a palindrome with the fewest operations, prioritizing lexicographically smallest result.

简单
2707

字符串中的额外字符

The problem asks for the minimum number of extra characters left after optimally breaking a string into substrings found…

中等
2710

移除字符串中的尾随零

Remove trailing zeros from a string representing a positive integer number.

简单
2712

使所有字符相等的最小成本

Find the minimum cost to make all characters of a binary string equal by performing two types of operations.

中等
2716

最小化字符串长度

Minimize String Length asks you to reduce a string by removing duplicates using a Hash Table strategy efficiently.

简单
2719

统计整数数目

Count of Integers challenges you to find the number of integers with a digit sum between a given range using dynamic pro…

困难
2730

找到最长的半重复子字符串

Find the length of the longest substring where at most one adjacent pair of digits repeats, using a sliding window appro…

中等
2734

执行子串操作后的字典序最小字符串

Given a string, perform operations to make it lexicographically smaller using a greedy approach with substring modificat…

中等
2744

最大字符串配对数目

Find the maximum number of pairs of distinct strings from an array where one string is the reverse of the other.

简单
2746

字符串连接删减字母

Solve the Decremental String Concatenation problem by applying dynamic programming to minimize string length after conca…

中等
2767

将字符串分割为最少的美丽子字符串

Partition a binary string into the fewest beautiful substrings using state transition dynamic programming and careful su…

中等
2781

最长合法子字符串的长度

This problem asks for the longest valid substring of a word that doesn't contain any substrings from a forbidden list.

困难
2785

将字符串中的元音字母排序

Sort Vowels in a String requires identifying vowels in a string and rearranging them in ascending order while keeping co…

中等
2788

按分隔符拆分字符串

Split Strings by Separator requires iterating through an array of strings and splitting each by a given separator charac…

简单
2800

包含三个字符串的最短字符串

Find the shortest string containing three given strings using a greedy approach while ensuring it is lexicographically s…

中等
2801

统计范围内的步进数字数目

Count the stepping numbers in a range using dynamic programming with state transitions between digits.

困难
2810

故障键盘

Simulate typing on a faulty keyboard where pressing 'i' reverses the string, requiring careful string manipulation track…

简单
2825

循环增长使字符串子序列等于另一个字符串

Determine if str2 can be made a subsequence of str1 by incrementing characters cyclically using at most one operation.

中等
2828

判别首字母缩略词

Check if a string can be formed by concatenating the first letters of each word in a given list.

简单
2833

距离原点最远的点

Determine the maximum distance from origin using string moves and counting underscores optimally for efficient calculati…

简单
2839

判断通过操作能否让字符串相等 I

Determine if two strings can be made equal by repeatedly swapping characters at any two indices in each string.

简单
2840

判断通过操作能否让字符串相等 II

Check if two strings can be made equal using operations that swap characters with the same parity.

中等
2842

统计一个字符串的 k 子序列美丽值最大的数目

Determine the number of k-length unique subsequences in a string that maximize the sum of character frequencies efficien…

困难
2844

生成特殊数字的最少操作

Minimize operations to make a number divisible by 25 by deleting digits. Use greedy choice and invariant validation.

中等
2851

字符串转换

Find how many ways string s can be transformed into string t in exactly k operations using suffix rotations.

困难
2864

最大二进制奇数

Rearrange a binary string to form the largest odd binary number using a greedy approach and least significant bit valida…

简单
2896

执行操作使两个字符串相等

Apply Operations to Make Two Strings Equal involves transforming binary strings with a cost-based dynamic programming ap…

中等
2900

最长相邻不相等子序列 I

Find the longest alternating subsequence in a string array based on a binary group array.

简单
2901

最长相邻不相等子序列 II

Find the longest subsequence of indices such that the corresponding strings have a valid Hamming distance and group cons…

中等
2904

最短且字典序最小的美丽子字符串

Find the shortest beautiful substring in a binary string and return the lexicographically smallest option efficiently us…

中等
2911

得到 K 个半回文串的最少修改次数

Minimize the number of letter changes to partition a string into k semi-palindromes using dynamic programming and two po…

困难
2914

使二进制字符串变美丽的最少修改次数

This problem involves determining the minimum number of changes to make a binary string beautiful using string-driven st…

中等
2933

高访问员工

Identify employees with high system access within one-hour periods based on access logs.

中等
2937

使三个字符串相等

Determine the minimum number of operations to make three strings equal by removing rightmost characters from one string …

简单
2938

区分黑球与白球

Solve the "Separate Black and White Balls" problem by swapping adjacent balls to group all black balls to the right with…

中等
2942

查找包含给定字符的单词

Identify all indices of words containing a specific character using array and string traversal techniques efficiently.

简单
2947

统计美丽子字符串 I

Given a string and a value k, count the number of beautiful substrings where vowels * consonants % k == 0.

中等
2949

统计美丽子字符串 II

Count Beautiful Substrings II focuses on finding beautiful substrings with hash tables and number theory techniques.

困难
2953

统计完全子字符串

Count Complete Substrings involves finding substrings where each character appears exactly k times with constraints on a…

困难
2957

消除相邻近似相等字符

Minimize operations to remove adjacent almost-equal characters using dynamic programming and greedy methods.

中等
2976

转换字符串的最小成本 I

This problem asks to calculate the minimum cost to convert a string from source to target using specific character trans…

中等
2977

转换字符串的最小成本 II

Compute the minimum cost to transform source into target using substring replacements with given costs efficiently using…

困难
2981

找出出现至少三次的最长特殊子字符串 I

Find the longest special substring in a string that appears at least three times, or return -1 if no such substring exis…

中等
2982

找出出现至少三次的最长特殊子字符串 II

Find the longest special substring that occurs at least three times in a given string using binary search and hash table…

中等
2983

回文串重新排列查询

Given a string and queries, check if rearranging specified substrings can make the string a palindrome.

困难
2999

统计强大整数的数目

Count the number of powerful integers in a given range by applying state transition dynamic programming with constraints…

困难
3003

执行操作后的最大分割数量

Maximizing the number of partitions in a string after changing one character and applying partitioning operations using …

困难
3006

找出数组中的美丽下标 I

Identify all beautiful indices where substring a appears and a nearby substring b exists within distance k efficiently.

中等
3008

找出数组中的美丽下标 II

Find Beautiful Indices in the Given Array II challenges you to use binary search and string matching techniques.

困难
3014

输入单词需要的最少按键次数 I

Calculate the minimum pushes to type a word using a remapped telephone keypad with greedy allocation of letters.

简单
3016

输入单词需要的最少按键次数 II

Given a word, find the minimum number of pushes to type it on a remapped keypad using a greedy approach.

中等
3019

按键变更的次数

Count how many times a user switches keys in a typed string, ignoring shift and caps lock variations in characters.

简单
3029

将单词恢复初始状态所需的最短时间 I

Determine the minimum seconds to revert a string to its original state using repeated prefix shifts of length k efficien…

中等
3031

将单词恢复初始状态所需的最短时间 II

The problem asks to calculate the minimum time required to revert a string to its initial state using specific operation…

困难
3035

回文字符串的最大数量

The problem focuses on maximizing the number of palindromes that can be formed from a given list of words through specif…

中等
3042

统计前后缀下标对 I

Count all index pairs where one word is both a prefix and suffix of another, using efficient array and string checks.

简单
3043

最长公共前缀的长度

Determine the length of the longest common prefix between two integer arrays using array scanning and hash lookup effici…

中等
3045

统计前后缀下标对 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 …

困难
3076

数组中的最短非公共子字符串

Find the shortest substring for each string in an array that does not appear in any other string efficiently using hashi…

中等
3081

替换字符串中的问号使分数最小

Minimize the cost of a string with '?' characters by replacing them with letters in lexicographical order while minimizi…

中等
3083

字符串及其反转中是否存在同一子字符串

Check for any substring of length 2 in a string and its reverse using a hash table and string comparison.

简单
3084

统计以给定字符开头和结尾的子字符串总数

Given a string and a character, find the total number of substrings that start and end with that character.

中等
3085

成为 K 特殊字符串需要删除的最少字符数

Minimize deletions to make a string k-special by adjusting character frequencies.

中等
3090

每个字符最多出现两次的最长子字符串

Find the maximum length substring where some substring occurs at least twice using a sliding window and hash mapping str…

简单
3093

最长公共后缀查询

Find the index of the string in wordsContainer with the longest common suffix for each query efficiently using array and…

困难
3106

满足距离约束且字典序最小的字符串

Minimize a string lexicographically using a series of operations constrained by a given integer k.

中等
3110

字符串的分数

Calculate the sum of absolute ASCII differences between adjacent characters to score any given string efficiently.

简单
3114

替换字符可以得到的最晚时间

Given a time string with "?" characters, replace them to form the latest valid 12-hour time.

简单
3120

统计特殊字母的数量 I

Count the number of special characters in a given string using hash tables and string manipulation.

简单
3121

统计特殊字母的数量 II

Count the Number of Special Characters II is a medium difficulty string and hash table problem that involves identifying…

中等
3136

有效单词

Determine if a given string qualifies as a valid word using a string-driven solution pattern with explicit character rul…

简单
3137

K 周期字符串需要的最少操作次数

The problem requires calculating the minimum number of operations to make a string k-periodic using specific substring r…

中等
3138

同位字符串连接的最小长度

The problem asks to find the minimum length of a string t such that s is a concatenation of anagrams of t.

中等
3143

正方形中的最多点数

Find the maximum number of points inside a valid square centered at the origin using a scanning and hashing approach.

中等
3144

分割字符频率相等的最少子字符串

Partition a string into substrings with equal character frequencies using dynamic programming and state transitions.

中等
3146

两个字符串的排列差

Compute the total index difference between two strings by mapping characters and summing their positional distances effi…

简单
3163

压缩字符串 III

Compress a string by repeatedly taking maximal same-character prefixes, following a string-driven solution strategy effi…

中等
3168

候诊室中的最少椅子数

Calculate the minimum number of chairs needed in a waiting room using string simulation and event tracking efficiently.

简单
3170

删除星号以后字典序最小的字符串

Find the lexicographically smallest string by removing stars using stack-based state management and careful character se…

中等
3174

清除数字

Remove all digits from a given string by applying a repeated operation to form the final string without digits.

简单
3210

找出加密后的字符串

In this problem, you need to encrypt a string by shifting each character's position based on a given integer value.

简单
3211

生成不含相邻零的二进制字符串

Generate all binary strings of length n without adjacent zeros using backtracking search with pruning for efficient enum…

中等
3213

最小代价构造字符串

This problem asks you to construct a target string using given words at minimal cost using dynamic programming technique…

困难
3216

交换后字典序最小的字符串

Lexicographically Smallest String After a Swap involves finding the smallest string after swapping adjacent digits with …

简单
3223

操作后字符串的最短长度

Find the minimum length of a string after performing operations based on character frequency.

中等
3227

字符串元音游戏

Solve the Vowels Game in a String using optimal moves and string analysis to predict the winner efficiently and accurate…

中等
3228

将 1 移动到末尾的最大操作次数

This problem requires finding the maximum number of operations to move ones to the end of a binary string.

中等
3234

统计 1 显著的字符串的数量

Count the number of substrings in a binary string with dominant ones, using a sliding window approach with state updates…

中等
3248

矩阵中的蛇

Solve the Snake in Matrix problem by simulating the snake's movement in a grid based on a series of directional commands…

简单
3258

统计满足 K 约束的子字符串数量 I

Count all substrings in a binary string that meet a given k-constraint using an efficient sliding window approach.

简单
3260

找出最大的 N 位 K 回文数

Compute the largest n-digit integer divisible by k that forms a palindrome using state transition dynamic programming te…

困难
3261

统计满足 K 约束的子字符串数量 II

Count Substrings That Satisfy K-Constraint II requires finding valid substrings in a binary string based on a k-constrai…

困难
3271

哈希分割字符串

Hash Divided String requires splitting a string into equal parts and combining character values modulo 26 to form a new …

中等
3274

检查棋盘方格颜色是否相同

Determine if two chessboard squares share the same color using coordinate math and simple string manipulation for quick …

简单
3280

将日期转换为二进制表示

Convert a given Gregorian date string to its binary format by transforming year, month, and day individually without lea…

简单
3291

形成目标字符串需要的最少字符串数 I

Use dynamic programming to split target into the fewest prefixes that match any word prefix, while ruling out dead posit…

中等
3292

形成目标字符串需要的最少字符串数 II

Compute the minimum number of valid strings from an array needed to construct a given target string efficiently using dy…

困难
3295

举报垃圾信息

Determine if a message contains at least two banned words using array scanning and hash lookup.

中等
3297

统计重新排列后包含另一个字符串的子字符串数目 I

Count the number of valid substrings in word1 that can be rearranged to contain word2 as a prefix.

中等
3298

统计重新排列后包含另一个字符串的子字符串数目 II

Count Substrings That Can Be Rearranged to Contain a String II involves identifying valid substrings with a sliding wind…

困难
3302

字典序最小的合法序列

Determine the lexicographically smallest valid index sequence by using state transition dynamic programming over word1 a…

中等
3303

第一个几乎相等子字符串的下标

Locate the first substring in s that is almost equal to pattern by allowing at most one character mismatch efficiently.

困难
3305

元音辅音字符串计数 I

Count all substrings containing every vowel and exactly k consonants using a sliding window and hash map state tracking.

中等
3306

元音辅音字符串计数 II

Count the number of substrings containing all vowels and exactly k consonants using a sliding window technique.

中等
3316

从原字符串里进行删除操作的最多次数

Determine the maximum number of characters you can remove from source while keeping pattern as a subsequence using array…

中等
3320

统计能获胜的出招序列数

Count The Number of Winning Sequences is a dynamic programming challenge involving state transitions based on Alice’s cr…

困难
3324

出现在屏幕上的字符串序列

Simulate Alice typing a target string with a special keyboard that appends letters one by one. Solve using string simula…

中等
3325

字符至少出现 K 次的子字符串 I

Calculate the total number of substrings where at least one character repeats k times using a sliding window efficiently…

中等
3327

判断 DFS 字符串是否是回文串

Determine if strings formed by DFS traversal of a tree are palindromes using array scanning and hash lookups efficiently…

困难
3330

找到初始输入字符串 I

Determine the length of the original string Alice intended to type by analyzing repeated characters and clumsy key press…

简单
3331

修改后子树的大小

Calculate the sizes of all subtrees after simultaneous parent changes using array scanning and hash-based counting effic…

中等
3333

找到初始输入字符串 II

Calculate how many potential original strings Alice might have intended to type, considering her clumsy typing behavior.

困难
3335

字符串转换后的长度 I

Calculate the total number of characters in a string after repeated transformations using dynamic programming and freque…

中等
3337

字符串转换后的长度 II

Calculate the length of a string after repeated transformations using state transition dynamic programming for large t v…

困难
3340

检查平衡字符串

Determine if a numeric string is balanced by comparing sums of digits at even and odd positions efficiently.

简单
3343

统计平衡排列的数目

Determine how many distinct permutations of a digit string are balanced using state transition dynamic programming effic…

困难
3348

最小可整除数位乘积 II

Find the smallest zero-free number at least as large as num whose digits multiply to a product divisible by t using care…

困难
3352

统计小于 N 的 K 可约简整数

This problem challenges you to count the K-reducible numbers less than a given binary integer using dynamic programming.

困难
3361

两个字符串的切换距离

Find the minimum cost of transforming one string into another, considering operations between characters.

中等
3365

重排子字符串以形成目标字符串

Determine if s can be split into k equal substrings and rearranged to match t using a hash table for frequency tracking.

中等
3387

两天自由外汇交易后的最大货币数

Compute the maximum currency amount after two days using graph traversal and depth-first search for optimal conversions.

中等
3389

使字符频率相等的最少操作次数

This Hard problem asks to transform a string so all character frequencies match using minimal deletions, leveraging dyna…

困难
3399

字符相同的最短子字符串 II

Find the minimal length of a substring with identical characters using binary search and controlled character flips effi…

困难
3403

从盒子中找出字典序最大的字符串 I

This problem involves finding the lexicographically largest string from a given word using a two-pointer approach.

中等
3407

子字符串匹配模式

Determine if a pattern containing a single wildcard can match any substring of a given string efficiently.

简单
3412

计算字符串的镜像分数

Calculate the mirror score of a string using stack-based state management for matching letters efficiently and accuratel…

中等
3435

最短公共超序列的字母出现频率

Compute all unique shortest common supersequences of given words using graph indegree tracking and topological ordering …

困难
3438

找到字符串中合法的相邻数字

Identify the first valid adjacent digit pair in a string where each digit appears exactly as many times as its numeric v…

简单
3441

变成好标题的最少代价

Solve Minimum Cost Good Caption with dynamic programming that builds minimum edit cost while enforcing character runs of…

困难
3442

奇偶频次间的最大差值 I

Find the maximum difference between the frequency of characters in a string with odd and even frequencies.

简单
3443

K 次修改后的最大曼哈顿距离

Solve Maximum Manhattan Distance After K Changes by scanning prefixes and testing the four diagonal target pairs with li…

中等
3445

奇偶频次间的最大差值 II

Find the maximum difference between even and odd character frequencies in substrings using sliding window updates effici…

困难
3448

统计可以被最后一个数位整除的子字符串数目

Count the number of substrings in a string divisible by their last non-zero digit using dynamic programming.

困难
3455

最短匹配子字符串

Find the shortest substring in a string that matches a pattern with exactly two wildcards efficiently using binary searc…

困难
3456

找出长度为 K 的特殊子字符串

Check efficiently if a string contains a consecutive sequence of length k where all characters match exactly one distinc…

简单
3458

选择 K 个互不重叠的特殊子字符串

Determine if k non-overlapping special substrings exist in a string using dynamic programming and careful substring trac…

中等
3461

判断操作后字符串中的数字是否相等 I

Simulate repeated adjacent digit sums modulo 10 until two digits remain, then check whether those final digits match.

简单
3463

判断操作后字符串中的数字是否相等 II

Determine if repeated digit-sum operations on a numeric string reduce it to two equal digits using math and string techn…

困难
3472

至多 K 次操作后的最长回文子序列

Find the longest palindromic subsequence of a string after performing at most k operations to adjust letters.

中等
3474

字典序最小的生成字符串

Generate the lexicographically smallest string by merging str1 and str2 using a greedy approach with invariant checks.

困难
3484

设计电子表格

Design a spreadsheet that supports setting, retrieving, and resetting values, with the ability to handle formulas refere…

中等
3485

删除元素后 K 个字符串的最长公共前缀

Find the longest common prefix length of k strings after removing an element in the array.

困难
3498

字符串的反转度

Calculate the reverse degree of a string by simulating operations on its characters based on their positions in the alph…

简单
3499

操作后最大活跃区段数 I

Maximize the number of active sections in a binary string by performing at most one trade operation.

中等
3501

操作后最大活跃区段数 II

Maximize the number of active sections in a binary string with at most one trade.

困难
3503

子字符串连接后的最长回文串 I

Compute the maximum palindrome length by concatenating substrings from two strings using state transition dynamic progra…

中等
3504

子字符串连接后的最长回文串 II

Compute the longest palindrome by concatenating substrings from two strings using state transition dynamic programming e…

困难
3517

最小回文排列 I

Build the smallest palindrome by sorting the left half counts and mirroring them around the optional middle character.

中等
3518

最小回文排列 II

Find the k-th lexicographically smallest palindromic rearrangement of a given palindromic string s.

困难
3519

统计逐位非递减的整数

Count all integers between l and r whose digits never decrease in base b using state transition dynamic programming effi…

困难
3522

执行指令后的得分

Simulate a series of add and jump instructions on arrays to compute the final score efficiently using array scanning and…

中等
3527

找到最常见的回答

Find the most common survey response after eliminating duplicates within each day, using array scanning and hash lookups…

中等
3529

统计水平子串和垂直子串重叠格子的数目

Efficiently count grid cells appearing in both horizontal and vertical occurrences of a given string pattern using array…

中等
3541

找到频率最高的元音和辅音

Given a string, calculate the sum of the most frequent vowel and consonant frequencies.

简单
3545

不同字符数量最多为 K 时的最少删除数

You need to delete characters in a string to reduce its distinct characters to at most k.

简单
3556

最大质数子字符串之和

Compute the sum of the three largest unique primes from all substrings using hash table plus math efficiently.

中等
3557

不相交子字符串的最大数量

Determine the maximum number of non-overlapping substrings in a word, each at least four characters and matching start-e…

中等
3561

移除相邻字符

This problem focuses on removing adjacent characters in a string using a stack-based approach until no more operations a…

中等
3563

移除相邻字符后字典序最小的字符串

Find the lexicographically smallest string by repeatedly removing adjacent characters optimally using dynamic programmin…

困难
3579

字符串转换需要的最小操作数

Transform word1 into word2 using minimal operations on substrings with a dynamic programming state transition approach.

困难
3582

为视频标题生成标签

Transform a video caption into a valid hashtag by simulating capitalization rules and truncation for long words efficien…

简单
3597

分割字符串

Partition a string into unique segments using hash table and string manipulation.

中等
3598

相邻字符串之间的最长公共前缀

Given an array of strings, find the longest common prefix length between adjacent strings after removals at each index.

中等
3602

十六进制和三十六进制转化

Solve Hexadecimal and Hexatrigesimal Conversion by converting n squared to base 16 and n cubed to base 36, then joining …

简单
3606

优惠券校验器

The Coupon Code Validator problem requires filtering and sorting coupons based on specific criteria for validity.

简单
3612

用特殊操作处理字符串 I

Simulate a series of operations on a string to transform it into the desired result using special characters.

中等
3614

用特殊操作处理字符串 II

Solve the problem of processing strings with special operations like '*' and '#' by simulating the rules left-to-right.

困难
3615

图中的最长回文路径

Find the longest path in a graph that forms a palindrome using state transition dynamic programming and bitmask techniqu…

困难

关联高频模式

LeetCode 字符串题型题解:699题训练路线