# README
"love",
"hate",
"yes"
}
输出: ["like", "love", "hate"]
### **Challenge**
遍历两次的办法很容易想到,如果只遍历一次你有没有什么好办法?
[传送门](./133-longestword.go)
## 135-combinationsum
### **Description**
中文English
给定一个候选数字的集合 `candidates` 和一个目标值 `target`. 找到 `candidates` 中所有的和为 `target` 的组合.
在同一个组合中, `candidates` 中的某个数字不限次数地出现.
所有数值 (包括 `target` ) 都是正整数.返回的每一个组合内的数字必须是非降序的.返回的所有组合之间可以是任意顺序.解集不能包含重复的组合.
### **Example**
**样例 1:**
输入: candidates = [2, 3, 6, 7], target = 7 输出: [[7], [2, 2, 3]]
**样例 2:**
输入: candidates = [1], target = 3 输出: [[1, 1, 1]]
[传送门](./135-combinationsum.go)
## 1324-countprimes
```cgo
计算小于非负数n的质数的个数。
Example
样例 1
输入: n = 2
输出: 0
样例 2
输入: n = 4
输出: 2
解析:2, 3 是素数
# Functions
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
给你一个整数n.
No description provided by the author
左子树 ---> 根结点 ---> 右子树BFS.
No description provided by the author
No description provided by the author
No description provided by the author
O(nlogn) 稳定.
O(n+mlogm) 超时,但是不稳定,最差的是O(n^2).
No description provided by the author
dp[i][j]表示A串匹配到i,B串匹配到j时的最大公共长度
dp[i][j]=dp[i-1][j-1]+1 ,A[i]==B[j]
dp[i][j]=0 ,A[i]!=B[j]
*/.
No description provided by the author
a,b必须已经是排序的的.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
超时.
原理:
$$
f(n)=[\farc{n!}{5}] + [\farc{n!}{5^2}] +\cdots + [\farc{n!}{5^n}]
$$
$$
q_0 = n
q_{i+1} = [\farc{q_i}{5}]
$$
$$
q_{i+1} = 0 <==> 5^{k+1} > n
$$
for q != 0 {
q /= 5 // ==> a1 + a2 + ..
O(N).
O(N^2).
设计一个算法,找出只含素因子2,3,5 的第 n 小的数。
符合条件的数如:1, 2, 3, 4, 5, 6, 8, 9, 10, 12..