"题目" 题意:从1 9中选出k个数之和等于n,这个k个数不能有相同的,输出所有可能的k个数字的集合,结果也不能重复 题解:暴搜,从n开始,每次减去1 9中的某个数字,然后继续递归。要注意剪枝,比如1 9中的数字大于n/k的是不可能存在答案中的,如果n 的值小于sum[k]也是不会有答案的。sum[ ...
分类:
其他好文 时间:
2020-02-22 13:42:33
阅读次数:
45
题目内容 Example: 分析过程 题目归类: 删除类型,在处理后需要删除值的问题。 题目分析: 边界分析: 空值分析 循环边界分析 方法分析: 数据结构分析 状态机 状态转移方程 最优解 测试用例构建 代码实现 效率提高 拓展问题 ...
分类:
其他好文 时间:
2020-02-20 13:09:06
阅读次数:
53
Given a set of candidate numbers (candidates) (without duplicates) and a target number (target), find all unique combinations in candidates where the ...
分类:
其他好文 时间:
2020-02-16 01:35:33
阅读次数:
58
Petr has just bought a new car. He's just arrived at the most known Petersburg's petrol station to refuel it when he suddenly discovered that the petr ...
分类:
其他好文 时间:
2020-02-12 00:42:21
阅读次数:
53
1,背诵单词:obstacle:障碍物 gum:口香糖 fridge:电冰箱 combination:结合 fasten:系牢 purchase:购买 leak:漏出 inhabitant:居民 express:快递 conceal:隐瞒 digest:消化 beggar:乞丐 apology:道歉 ...
分类:
其他好文 时间:
2020-02-09 23:45:06
阅读次数:
84
一、题目说明 题目39. Combination Sum,是从正数列表中选取几个,其和等于目标数的可能组合。任何一个数可以重复取,如candidates = [2,3,6,7], target = 7,结果集合是[ [7], [2,2,3] ] 如candidates = [2,3,5], targ ...
分类:
其他好文 时间:
2020-02-09 09:57:56
阅读次数:
66
#include <iostream> #include <cstdlib> /* include to allow rand() to be used */ #include<ctime>/*just used in function: time(NULL)*/ using namespace s ...
分类:
其他好文 时间:
2020-01-30 15:49:00
阅读次数:
76
https://leetcode-cn.com/problems/combination-sum-ii/solution/hui-su-suan-fa-jian-zhi-python-dai-ma-java-dai-m-3/ 给定一个数组 candidates 和一个目标数 target ,找出 c ...
分类:
其他好文 时间:
2020-01-19 14:10:11
阅读次数:
80
1. Several terminologies: Address: Subnet: Subnet mask: A 32-bit combination used to describe which portion of an adress refers to the subnet and whic ...
分类:
Web程序 时间:
2019-12-27 10:08:18
阅读次数:
128
Design an Iterator class, which has: A constructor that takes a string characters of sorted distinct lowercase English letters and a number combinatio ...
分类:
其他好文 时间:
2019-12-22 10:23:29
阅读次数:
99