上一页 1 2 3 4 5 6 ··· 51 下一页
摘要: 还是套模板,模板可参考:https://www.cnblogs.com/panweiwei/p/14025143.html class Solution(object): def __init__(self): self.res = [] def combine(self, n, k): """ : 阅读全文
posted @ 2020-11-23 16:38 人间烟火地三鲜 阅读(118) 评论(0) 推荐(0) 编辑
摘要: 原串里有数字、也有字母,所以每选一个字符要加以判断,要是字母则有两种选择,数字就一种。 还是套模板,模板可参考:https://www.cnblogs.com/panweiwei/p/14025143.html class Solution(object): def __init__(self): 阅读全文
posted @ 2020-11-23 16:36 人间烟火地三鲜 阅读(233) 评论(0) 推荐(0) 编辑
摘要: 套模板,可参考:https://www.cnblogs.com/panweiwei/p/14025143.html class Solution(object): def __init__(self): self.res = [] def subsetsWithDup(self, nums): "" 阅读全文
posted @ 2020-11-23 16:34 人间烟火地三鲜 阅读(73) 评论(0) 推荐(0) 编辑
摘要: 套模板,可参考:https://www.cnblogs.com/panweiwei/p/14025143.html class Solution(object): def __init__(self): self.res = [] def subsets(self, nums): """ :type 阅读全文
posted @ 2020-11-23 16:33 人间烟火地三鲜 阅读(96) 评论(0) 推荐(0) 编辑
摘要: 套模板,可参考:https://www.cnblogs.com/panweiwei/p/14025143.html class Solution(object): def __init__(self): self.res = [] def permuteUnique(self, nums): """ 阅读全文
posted @ 2020-11-23 16:31 人间烟火地三鲜 阅读(70) 评论(0) 推荐(0) 编辑
摘要: 套模板,可参考:https://www.cnblogs.com/panweiwei/p/14025143.html class Solution(object): def __init__(self): self.res = [] def permute(self, nums): """ :type 阅读全文
posted @ 2020-11-23 16:30 人间烟火地三鲜 阅读(95) 评论(0) 推荐(0) 编辑
摘要: 可参考:https://www.cnblogs.com/panweiwei/p/14025143.html class Solution(object): def __init__(self): self.res = [] def combinationSum2(self, candidates, 阅读全文
posted @ 2020-11-23 16:28 人间烟火地三鲜 阅读(61) 评论(0) 推荐(0) 编辑
摘要: 可参考:https://www.cnblogs.com/panweiwei/p/14025143.html class Solution(object): def __init__(self): self.res = [] def combinationSum(self, candidates, t 阅读全文
posted @ 2020-11-23 16:27 人间烟火地三鲜 阅读(91) 评论(0) 推荐(0) 编辑
摘要: 可参考:https://www.cnblogs.com/panweiwei/p/14025143.html class Solution(object): def __init__(self): self.res = [] self.mydict = {1: "", 2: "abc", 3: "de 阅读全文
posted @ 2020-11-23 16:25 人间烟火地三鲜 阅读(305) 评论(0) 推荐(0) 编辑
摘要: 参考:https://zhuanlan.zhihu.com/p/302415065 关于回溯 回溯是递归的“副产品”,并非高效算法,通过剪枝可以跳过非必要的搜索。 回溯算法能解决如下问题: 组合问题:N个数里面按一定规则找出k个数的集合; 排列问题:N个数按一定规则全排列,有几种排列方式; 切割问题 阅读全文
posted @ 2020-11-23 16:19 人间烟火地三鲜 阅读(388) 评论(0) 推荐(1) 编辑
上一页 1 2 3 4 5 6 ··· 51 下一页
点击右上角即可分享
微信分享提示