题库chevron_right分类chevron_right字符串匹配
label

字符串匹配

33 道题目
简单: 10中等: 8困难: 15

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

面试场景

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

常见误区

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

练习策略

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

推荐练习顺序

题库

字符串匹配 题库

先展示一段最适合快速浏览的题目列表,继续滚动时再慢慢续载,避免专题页被长列表一下子拉穿。

慢加载专题题库

适合这类题很多的专题,先扫结构,再逐步深入。

hourglass_bottom滚动续载
search
tune难度

当前展示 24 / 33 道题目

每次续载 24 题
#题目难度
28

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

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

简单
214

最短回文串

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

困难
459

重复的子字符串

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

简单
572

另一棵树的子树

Determine if one binary tree is an exact subtree of another by comparing structure and node values recursively.

简单
686

重复叠加字符串匹配

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

中等
796

旋转字符串

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

简单
1023

驼峰式匹配

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

中等
1392

最长快乐前缀

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

困难
1397

找到所有好字符串

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

困难
1408

数组中的字符串匹配

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

简单
1455

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

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

简单
1668

最大重复子字符串

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

简单
1764

通过连接另一个数组的子数组得到一个数组

Determine if you can sequentially select disjoint subarrays from nums matching each group in order using two-pointer sca…

中等
2185

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

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

简单
2223

构造字符串的总得分和

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

困难
2301

替换字符后匹配

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

困难
2430

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

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

困难
2851

字符串转换

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

困难
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.

困难
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…

困难
3034

匹配模式数组的子数组数目 I

Count all subarrays in a given integer array that strictly follow a defined numeric pattern using rolling hash checks ef…

中等
3036

匹配模式数组的子数组数目 II

Count subarrays matching a pattern of relative values using array transformation and rolling hash techniques.

困难

swap_vert在题库框内继续向下滚动,也会自动续载

关联高频模式

LeetCode 字符串匹配题型题解:33题训练路线