题库chevron_right解题模式chevron_right哈希·表·结合·string
schema可复用解题模式

哈希·表·结合·string模式

模式页更适合建立可迁移的解题框架。先抓识别信号,再反复练状态定义、更新规则和边界解释,能比零散刷题更快形成稳定手感。

database58 道题tune35/22/1 难度梯度category6 个关联题型

模式摘要

先识别什么

题目里常出现可以复用的状态更新节奏。

解法节奏

先口述状态和不变量,再解释每一步如何更新,最后用反例验证边界。

高频失分点

状态定义说不清,写出来也难以稳定维护。

识别信号

  • 题目里常出现可以复用的状态更新节奏。
  • 暴力枚举太慢,但结构上存在可维护的不变量。
  • 面试追问通常会盯住边界、状态变更和复杂度。

解题流程

  1. 1. 明确窗口/状态定义
  2. 2. 更新状态并维护约束
  3. 3. 用边界样例验证

常见失分点

  • 状态定义说不清,写出来也难以稳定维护。
  • 只会背模板,解释不了为什么这样更新。
  • 样例能过,但边界和复杂度追问容易崩。

推荐题单梯度

题库

哈希·表·结合·string模式题库

这里更适合先按关键词或难度找题,再按关联题型切入。题库会在容器内继续滚动时慢慢续载,避免模式页被长列表一下子拉穿。

慢加载模式题库

适合先建模式理解,再扩展到完整题单。

hourglass_bottom容器内滚动续载
search
tune难度
category题型聚焦

当前展示 24 / 58 道题目

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

中等
242

有效的字母异位词

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

简单
290

单词规律

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

简单
299

猜数字游戏

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

中等
383

赎金信

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

简单
389

找不同

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

简单
535

TinyURL 的加密与解密

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

中等
677

键值映射

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

中等
771

宝石与石头

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

简单
791

自定义字符串排序

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

中等
859

亲密字符串

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

简单
884

两句话中的不常见单词

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

简单
1138

字母板上的路径

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

中等
1189

“气球” 的最大数量

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

简单
1347

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

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

中等
1370

上升下降字符串

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

简单
1396

设计地铁系统

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

中等
1410

HTML 实体解析器

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

中等
1461

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

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

中等
1496

判断路径是否相交

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

简单
1540

K 次操作转变字符串

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

中等
1542

找出最长的超赞子字符串

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

困难
1624

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

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

简单

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

按题型继续深入

模式学会之后,最好回到具体题型里做迁移训练。这样更容易分清楚“模式本身”和“场景变化”分别在哪里。

route

引导式练习路径

AI 会按你的当前水平推荐题目,并持续记录练习进度。

开始引导练习arrow_forward
LeetCode 哈希·表·结合·string模式题解:58题训练路线