题库chevron_right分类chevron_right字符串
text_fields

字符串

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

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

面试场景

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

常见误区

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

练习策略

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

推荐练习顺序

题库

字符串 题库

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

慢加载专题题库

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

hourglass_bottom滚动续载
search
tune难度

当前展示 24 / 699 道题目

每次续载 24 题
#题目难度
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…

中等

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

关联高频模式

LeetCode 字符串题型题解:699题训练路线