摘要:
https://leetcode.cn/problems/word-break/description/ class Solution { public boolean wordBreak(String s, List<String> wordDict) { // 思路较为巧妙,和传统背包定义不同 阅读全文
posted @ 2024-09-04 19:14
风乐
阅读(21)
评论(0)
推荐(0)
摘要:
https://leetcode.cn/problems/perfect-squares/description/ 简单完全背包,需要注意的是由于求的是最小,因此初始化时需要把初始层f[0]全置为无穷大,用于保证一定能计算出min具体可以看灵神的解释 递归边界:dfs(0,0)=0,因为没有数可以选 阅读全文
posted @ 2024-09-04 02:48
风乐
阅读(33)
评论(0)
推荐(0)

浙公网安备 33010602011771号