面试场景
高频考察问题建模、边界条件与口头表达的清晰度。
常见误区
只背模板不解释为什么,容易在追问里失分。
练习策略
每轮练 3-5 题,固定复盘复杂度和可替代解法。
推荐练习顺序
题库
计数 题库
先展示一段最适合快速浏览的题目列表,继续滚动时再慢慢续载,避免专题页被长列表一下子拉穿。
慢加载专题题库
适合这类题很多的专题,先扫结构,再逐步深入。
当前展示 24 / 149 道题目
每次续载 24 题多数元素
Find the majority element in an array, where the element appears more than n/2 times, using efficient algorithms.
多数元素 II
Identify all elements in an integer array appearing more than ⌊ n/3 ⌋ times using efficient array scanning and hash coun…
猜数字游戏
Solve the Bulls and Cows problem using hash tables and string manipulation to track exact and misplaced digits.
前 K 个高频元素
Find the k most frequent elements from an array using efficient algorithms like hashing and sorting.
赎金信
Determine if a ransom note can be constructed from a magazine's letters using hash tables and string counting techniques…
字符串中的第一个唯一字符
Find the index of the first non-repeating character in a string using efficient queue-driven state processing.
根据字符出现频率排序
Sort Characters By Frequency requires counting characters efficiently and rearranging a string in descending frequency o…
最长和谐子序列
Find the length of the longest harmonious subsequence in an integer array using array scanning and hash-based frequency …
任务调度器
Task Scheduler is solved by counting task frequencies and computing how cooldown gaps force idle slots around the most f…
前K个高频单词
Solve Top K Frequent Words by counting each word, then ordering ties alphabetically so frequency wins before lexicograph…
重构字符串
Reorganize a string so that no two adjacent characters are the same, if possible, using a greedy approach.
子域名访问计数
The Subdomain Visit Count problem requires counting the visits to all subdomains of a given domain from a list of count-…
最常见的单词
Find the most frequent non-banned word in a paragraph, excluding punctuation, using an efficient array scan and hash tab…
重新排序得到 2 的幂
Determine if a number's digits can be rearranged to form a power of two using counting and hash-based checks.
两句话中的不常见单词
Find uncommon words from two sentences by counting word frequencies using hash tables.
RLE 迭代器
Design an efficient iterator for a run-length encoded array, handling large counts and sequential access correctly every…
卡牌分组
Solve the problem of determining if a deck can be partitioned into groups with equal occurrences of card values.
三数之和的多种可能
Count all unique triplets in an integer array whose sum equals the target, handling multiplicity efficiently using hashi…
使数组唯一的最小增量
This problem challenges you to find the minimum moves to make all elements in an array unique by incrementing elements.
K 个不同整数的子数组
Find subarrays with exactly k distinct integers in an integer array using sliding window and hash lookup techniques.
总持续时间可被 60 整除的歌曲
Calculate the number of song pairs whose total durations sum to a multiple of 60 using array scanning and hash lookups.
距离相等的条形码
Rearrange barcodes in an array so that no two adjacent elements are equal, using a greedy approach and hash table for ef…
活字印刷
Compute all unique non-empty sequences from given letter tiles using backtracking search with pruning efficiently.
受标签影响的最大值
Maximize the sum of selected item values while respecting label use limits using array scanning and hash tracking.
swap_vert在题库框内继续向下滚动,也会自动续载