题库chevron_right分类chevron_right位掩码
label

位掩码

47 道题目
简单: 0中等: 12困难: 35

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

面试场景

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

常见误区

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

练习策略

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

推荐练习顺序

题库

位掩码 题库

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

慢加载专题题库

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

hourglass_bottom滚动续载
search
tune难度

当前展示 24 / 47 道题目

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

我能赢吗

Determine if the first player can guarantee a win in a turn-based number selection game using state transition dynamic p…

中等
473

火柴拼正方形

The problem asks to determine if we can use matchsticks to form a square, exploring dynamic programming and backtracking…

中等
526

优美的排列

The Beautiful Arrangement problem asks for the number of valid permutations of n integers satisfying specific divisibili…

中等
638

大礼包

Minimize the cost of purchasing items using available special offers with state transition dynamic programming.

中等
691

贴纸拼词

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

困难
698

划分为k个相等的子集

Determine if an integer array can be partitioned into k subsets where each subset sums to the same value using DP and ba…

中等
805

数组的均值分割

Determine whether an integer array can be partitioned into two non-empty subarrays with the same average using dynamic p…

困难
847

访问所有节点的最短路径

Solve the Shortest Path Visiting All Nodes problem by exploring dynamic programming, bit manipulation, and breadth-first…

困难
943

最短超级串

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

困难
996

平方数组的数目

Count the number of squareful arrays from the given list of integers by checking adjacent pairs' sums for perfect square…

困难
1125

最小的必要团队

Find the smallest subset of people covering all required skills using bitmask dynamic programming for efficient state tr…

困难
1255

得分最高的单词集合

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

困难
1349

参加考试的最大学生数

Calculate the maximum number of students who can take an exam without cheating using state transition dynamic programmin…

困难
1434

每个人戴不同帽子的方案数

Calculate all unique assignments of hats to people using state transition dynamic programming with bitmasking for collis…

困难
1494

并行课程 II

Determine the minimum semesters to complete all courses with prerequisites using state transition dynamic programming an…

困难
1595

连通两组点的最小成本

Compute the minimum cost to fully connect two groups of points using dynamic programming and bitmasking efficiently.

困难
1617

统计子树中城市之间最大距离

This problem asks you to count subtrees in a tree structure where the maximum distance between any two cities matches sp…

困难
1655

分配重复整数

Determine if you can allocate integers to satisfy customer quantities using state transition dynamic programming techniq…

困难
1659

最大化网格幸福感

Maximize Grid Happiness is a dynamic programming problem focusing on state transitions with bitmasking to maximize happi…

困难
1681

最小不兼容性

Optimize the sum of incompatibilities when distributing an array into subsets with unique elements.

困难
1723

完成所有工作的最短时间

Minimize the maximum working time of k workers by optimally assigning jobs, leveraging dynamic programming and bit manip…

困难
1755

最接近目标值的子序列和

Find the minimum absolute difference between a target goal and any subsequence sum using optimized dynamic programming a…

困难
1799

N 次操作后的最大分数和

Maximize the score after n operations by selecting pairs from the array and using their GCD with dynamic programming or …

困难
1815

得到新鲜甜甜圈的最多组数

Reorder groups to maximize happy customers by using state transition dynamic programming with bitmasking for optimal bat…

困难

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

关联高频模式

LeetCode 位掩码题型题解:47题训练路线