会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
张宵
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
3
4
5
6
7
8
9
10
···
22
下一页
2021年8月22日
单词拆分
摘要: 题目链接:https://leetcode-cn.com/problems/word-break 题目描述: 给定一个非空字符串 s 和一个包含非空单词的列表 wordDict,判定 s 是否可以被空格拆分为一个或多个在字典中出现的单词。 说明: 拆分时可以重复使用字典中的单词。 你可以假设字典中没
阅读全文
posted @ 2021-08-22 14:44 张宵
阅读(71)
评论(0)
推荐(0)
2021年8月21日
完全平方数
摘要: 题目链接:https://leetcode-cn.com/problems/perfect-squares/ 题目描述: 给定正整数 n,找到若干个完全平方数(比如 1, 4, 9, 16, ...)使得它们的和等于 n。你需要让组成和的完全平方数的个数最少。 给你一个整数 n ,返回和为 n 的完
阅读全文
posted @ 2021-08-21 13:52 张宵
阅读(871)
评论(0)
推荐(0)
2021年8月20日
零钱兑换
摘要: 题目链接:https://leetcode-cn.com/problems/coin-change 题目描述: 给你一个整数数组 coins ,表示不同面额的硬币;以及一个整数 amount ,表示总金额。 计算并返回可以凑成总金额所需的 最少的硬币个数 。如果没有任何一种硬币组合能组成总金额,返回
阅读全文
posted @ 2021-08-20 16:03 张宵
阅读(95)
评论(0)
推荐(0)
2021年8月19日
组合总数
摘要: 题目链接:https://leetcode-cn.com/problems/combination-sum-iv 题目描述: 给你一个由 不同 整数组成的数组 nums ,和一个目标整数 target 。请你从 nums 中找出并返回总和为 target 的元素组合的个数。 题目数据保证答案符合 3
阅读全文
posted @ 2021-08-19 19:36 张宵
阅读(35)
评论(0)
推荐(0)
2021年8月18日
零钱兑换||
摘要: 题目链接:https://leetcode-cn.com/problems/coin-change-2 题目描述: 给你一个整数数组 coins 表示不同面额的硬币,另给一个整数 amount 表示总金额。 请你计算并返回可以凑成总金额的硬币组合数。如果任何硬币组合都无法凑出总金额,返回 0 。 假
阅读全文
posted @ 2021-08-18 11:05 张宵
阅读(74)
评论(0)
推荐(0)
2021年8月17日
编辑距离
摘要: 题目链接:https://leetcode-cn.com/problems/edit-distance 题目描述: 给你两个单词 word1 和 word2,请你计算出将 word1 转换成 word2 所使用的最少操作数 。 你可以对一个单词进行如下三种操作: 插入一个字符 删除一个字符 替换一个
阅读全文
posted @ 2021-08-17 12:56 张宵
阅读(26)
评论(0)
推荐(0)
2021年8月15日
谷与峰
摘要: 题目链接:https://leetcode-cn.com/problems/peaks-and-valleys-lcci 题目描述: 在一个整数数组中,“峰”是大于或等于相邻整数的元素,相应地,“谷”是小于或等于相邻整数的元素。例如,在数组{5, 8, 4, 2, 3, 4, 6}中,{8, 6}是
阅读全文
posted @ 2021-08-15 15:42 张宵
阅读(155)
评论(0)
推荐(0)
递增的三元组
摘要: 题目链接:https://leetcode-cn.com/problems/increasing-triplet-subsequence 题目描述: 给你一个整数数组 nums ,判断这个数组中是否存在长度为 3 的递增子序列。 如果存在这样的三元组下标 (i, j, k) 且满足 i < j <
阅读全文
posted @ 2021-08-15 15:37 张宵
阅读(113)
评论(0)
推荐(0)
2021年8月14日
一和零
摘要: 题目链接: https://leetcode-cn.com/problems/ones-and-zeroes/ 题目描述: 题解: class Solution { public: int findMaxForm(vector<string>& strs, int m, int n) { vecto
阅读全文
posted @ 2021-08-14 15:56 张宵
阅读(150)
评论(0)
推荐(0)
2021年8月13日
目标和
摘要: 题目链接:https://leetcode-cn.com/problems/target-sum 题目描述: 给你一个整数数组 nums 和一个整数 target 。 向数组中的每个整数前添加 '+' 或 '-' ,然后串联起所有整数,可以构造一个 表达式 : 例如,nums = [2, 1] ,可
阅读全文
posted @ 2021-08-13 14:23 张宵
阅读(58)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
7
8
9
10
···
22
下一页
公告