题库chevron_right分类chevron_right记忆化
note

记忆化

41 道题目
简单: 3中等: 11困难: 27

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

面试场景

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

常见误区

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

练习策略

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

推荐练习顺序

#题目难度
70

爬楼梯

Climbing Stairs is a classic dynamic programming problem where you calculate distinct ways to reach the top using step t…

简单
139

单词拆分

Determine if a string can be fully segmented into dictionary words using array scanning and hash-based lookups for effic…

中等
140

单词拆分 II

Given a string and dictionary, return all possible sentences by adding spaces where each word is in the dictionary.

困难
241

为运算表达式设计优先级

Solve Different Ways to Add Parentheses by splitting on each operator and memoizing every subexpression result list.

中等
329

矩阵中的最长递增路径

Find the length of the longest increasing path in a matrix with given movement constraints using graph techniques.

困难
397

整数替换

Find the minimum number of operations to reduce a number to 1 by applying specific operations, using state transition dy…

中等
464

我能赢吗

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

中等
488

祖玛游戏

The Zuma Game involves clearing balls from the board using a limited hand, applying dynamic programming and state transi…

困难
509

斐波那契数

Calculate the nth Fibonacci number using state transition dynamic programming and recursive techniques efficiently in in…

简单
546

移除盒子

Maximize points by strategically removing contiguous same-colored boxes using state transition dynamic programming and m…

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

中等
773

滑动谜题

Determine the minimum moves to solve a 2x3 sliding puzzle using BFS and state transition dynamic programming techniques …

困难
894

所有可能的真二叉树

Generate all possible full binary trees with n nodes, focusing on dynamic programming and binary tree traversal.

中等
913

猫和老鼠

Determine the outcome of a two-player Cat and Mouse game on a graph using topological ordering and memoized dynamic prog…

困难
964

表示数字的最少运算符

Compute the minimum number of arithmetic operators to form a target using repeated x with addition, subtraction, multipl…

困难
1137

第 N 个泰波那契数

Compute the N-th Tribonacci number using state transition dynamic programming with careful memoization and iterative upd…

简单
1387

将整数按权重排序

Sort integers in a range based on their power value using dynamic programming and memoization, handling ties with ascend…

中等
1444

切披萨的方案数

This problem challenges you to determine the number of valid ways to cut a pizza into pieces with apples using dynamic p…

困难
1553

吃掉 N 个橘子的最少天数

Find the minimum number of days to eat n oranges using state transition dynamic programming with memoization.

困难
1569

将子数组重新排序得到同一个二叉搜索树的方案数

Determine the number of ways to reorder an array to get the same binary search tree (BST) from its insertion order.

困难
1575

统计所有可行路径

This problem requires counting all possible routes between cities using fuel efficiently with state transition dynamic p…

困难
1611

使整数变为 0 的最少操作次数

Compute the minimum number of one-bit operations to convert a given integer to zero using state transition dynamic progr…

困难
1659

最大化网格幸福感

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

困难
1728

猫和老鼠 II

Cat and Mouse II requires determining if the mouse can reach food before being caught using graph and topological orderi…

困难
1815

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

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

困难
1857

有向图中最大颜色值

Compute the maximum color frequency along any valid path in a directed graph using topological ordering and dynamic prog…

困难
1900

最佳运动员的比拼回合

This problem requires finding the earliest and latest rounds where two players compete using dynamic programming with st…

困难
2019

解出数学表达式的学生分数

Calculate student scores for a single-digit math expression using state transition dynamic programming to track all vali…

困难
2311

小于等于 K 的最长二进制子序列

Find the longest subsequence in a binary string that forms a number less than or equal to a given integer k.

中等
2312

卖木头块

Maximize your profit by cutting a wooden piece into smaller parts based on given prices and dimensions.

困难
2318

不同骰子序列的数目

Calculate the number of distinct sequences of dice rolls based on specific conditions using dynamic programming.

困难
2328

网格图中递增路径的数目

Solve Number of Increasing Paths in a Grid by turning cell comparisons into a DAG and counting paths with topological DP…

困难
2713

矩阵中严格递增的单元格数

Find the maximum number of cells that can be visited in a matrix by following strictly increasing values from a starting…

困难
2876

有向图访问计数

Count Visited Nodes in a Directed Graph uses dynamic programming to solve graph traversal and node visitation counting e…

困难
2920

收集所有金币可获得的最大积分

Find the maximum points after collecting coins from all nodes of a tree using binary-tree traversal and state tracking.

困难
2998

使 X 和 Y 相等的最少操作次数

Determine the minimum operations to make two integers equal using increment, decrement, and division efficiently with DP…

中等
3040

相同分数的最大操作数目 II

This problem asks to maximize operations on an integer array where all deletions produce the same score using dynamic pr…

中等
3154

到达第 K 级台阶的方案数

Determine the total number of ways to reach the k-th stair using a state transition dynamic programming approach with co…

困难
3459

最长 V 形对角线段的长度

Compute the maximum length of a V-shaped diagonal segment in a 2D integer matrix using state transition dynamic programm…

困难

关联高频模式

LeetCode 记忆化题型题解:41题训练路线