Skip to content

Commit c3d63a9

Browse files
committed
remove src dir
1 parent 346d706 commit c3d63a9

File tree

112 files changed

+101
-2124
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+101
-2124
lines changed

note/001/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ return [0, 1].
2121

2222
遍历数组,使用一个 HashMap 记录数组里的数及其索引,如果总数与当前数的差值在 HashMap 里存在相应的记录,就找到了。
2323

24-
## [完整代码][src]
24+
## 实现代码
2525

2626
```java
2727
class Solution {
@@ -47,4 +47,4 @@ class Solution {
4747
```
4848

4949
[title]: https://leetcode.com/problems/two-sum
50-
[src]: https://github.com/andavid/leetcode-java/blob/master/src/com/andavid/leetcode/_001/Solution.java
50+

note/007/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Assume we are dealing with an environment which could only hold integers within
3232
## 思路
3333
使用长整型保存结果。依次模 10 得到最右边一位。
3434

35-
## [完整代码][src]
35+
## 实现代码
3636

3737
```java
3838
class Solution {
@@ -50,4 +50,4 @@ class Solution {
5050
```
5151

5252
[title]: https://leetcode.com/problems/reverse-integer
53-
[src]: https://github.com/andavid/leetcode-java/blob/master/src/com/andavid/leetcode/_007/Solution.java
53+

note/008/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ If no valid conversion could be performed, a zero value is returned. If the corr
2929
3. 然后依次读取字符,如果是非数字字符或者数值超过 INT 最大值退出
3030
4. 结果乘以标志位,和 INT 最大值、INT 最小值进行比较
3131

32-
## [完整代码][src]
32+
## 实现代码
3333

3434
```java
3535
class Solution {
@@ -78,4 +78,4 @@ class Solution {
7878
```
7979

8080
[title]: https://leetcode.com/problems/string-to-integer-atoi
81-
[src]: https://github.com/andavid/leetcode-java/blob/master/src/com/andavid/leetcode/_008/Solution.java
81+

note/013/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Input is guaranteed to be within the range from 1 to 3999.
2020

2121
根据以上几个规则,主要是右加左减,可以从右往左扫描字符串,如果遇到 I、X、C 判断是减还是加,如果遇到其他罗马数字,直接累加。
2222

23-
## [完整代码][src]
23+
## 实现代码
2424

2525
```java
2626
class Solution {
@@ -58,4 +58,4 @@ class Solution {
5858
```
5959

6060
[title]: https://leetcode.com/problems/roman-to-integer
61-
[src]: https://github.com/andavid/leetcode-java/blob/master/src/com/andavid/leetcode/_013/Solution.java
61+

note/014/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ LCP(S<sub>mid+1</sub>...S<sub>j</sub>),其中 mid = (i+j) / 2.
1616

1717
根据这两个子问题的解,即可求出最长公共前缀。
1818

19-
## [完整代码][src]
19+
## 实现代码
2020

2121
```java
2222
class Solution {
@@ -97,5 +97,5 @@ class Solution {
9797
```
9898

9999
[title]: https://leetcode.com/problems/longest-common-prefix
100-
[src]: https://github.com/andavid/leetcode-java/blob/master/src/com/andavid/leetcode/_014/Solution.java
100+
101101
[src2]: https://github.com/andavid/leetcode-java/blob/master/src/com/andavid/leetcode/_014/Solution2.java

note/019/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Try to do this in one pass.
2121

2222
如果知道链表的长度,就可以从前往后一次遍历就可以了。但是求链表长度还需要遍历一次,因此总共需要两次遍历。题目要求使用一次遍历,可以使用两个指针来实现。初始都指向 head,第一个指针前进 N 步,然后两个指针同时前进直到第一个指针到达链表末尾,第二个指针后面的那个节点就是要移除的节点。
2323

24-
## [完整代码][src]
24+
## 实现代码
2525

2626
```java
2727
/**
@@ -56,4 +56,4 @@ class Solution {
5656
```
5757

5858
[title]: https://leetcode.com/problems/remove-nth-node-from-end-of-list
59-
[src]: https://github.com/andavid/leetcode-java/blob/master/src/com/andavid/leetcode/_019/Solution.java
59+

note/020/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ The brackets must close in the correct order, "()" and "()[]{}" are all valid bu
1010

1111
使用一个堆栈,遍历字符串的字符,遇到 '(' 压入 ')',遇到 '{' 压入 '}',遇到 '[' 压入 ']',遇到其他字符时,判断是否与栈顶字符相同。
1212

13-
## [完整代码][src]
13+
## 实现代码
1414

1515
```java
1616
class Solution {
@@ -34,4 +34,4 @@ class Solution {
3434
```
3535

3636
[title]: https://leetcode.com/problems/valid-parentheses
37-
[src]: https://github.com/andavid/leetcode-java/blob/master/src/com/andavid/leetcode/_020/Solution.java
37+

note/021/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Output: 1->1->2->3->4->4
1313

1414
遍历两个链表,比较两个链表节点的大小,修改当前节点使其指向较小的那个节点。
1515

16-
## [完整代码][src]
16+
## 实现代码
1717

1818
```java
1919
/**
@@ -90,5 +90,5 @@ class Solution {
9090
```
9191

9292
[title]: https://leetcode.com/problems/merge-two-sorted-lists
93-
[src]: https://github.com/andavid/leetcode-java/blob/master/src/com/andavid/leetcode/_021/Solution.java
93+
9494
[src2]: https://github.com/andavid/leetcode-java/blob/master/src/com/andavid/leetcode/_021/Solution2.java

note/026/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ It doesn't matter what you leave beyond the new length.
2222

2323
判断长度小于等于 1 的话直接返回原长度即可,否则的话遍历一遍数组,用一个 tail 变量指向新的数组尾部,如果后面的元素和前面的元素不同,就让后面的元素写到 tail 所指数组元素,然后 tail 变量加一,最后返回 tail 即可。
2424

25-
## [完整代码][src]
25+
## 实现代码
2626

2727
```Java
2828
class Solution {
@@ -43,4 +43,4 @@ class Solution {
4343
```
4444

4545
[title]: https://leetcode.com/problems/remove-duplicates-from-sorted-array
46-
[src]: https://github.com/andavid/leetcode-java/blob/master/src/com/andavid/leetcode/_026/Solution.java
46+

note/028/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Output: -1
2424

2525
太简单了吧,indexOf 搞定。
2626

27-
## [完整代码][src]
27+
## 实现代码
2828

2929
```java
3030
class Solution {
@@ -38,4 +38,4 @@ class Solution {
3838
```
3939

4040
[title]: https://leetcode.com/problems/implement-strstr
41-
[src]: https://github.com/andavid/leetcode-java/blob/master/src/com/andavid/leetcode/_028/Solution.java
41+

note/036/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ A valid Sudoku board (partially filled) is not necessarily solvable. Only the fi
2020

2121
因此,只需要从左往右,从上到下,依次遍历 board 里的数字,一旦发现数字所在的行、列或小九宫格里该数字对应的位置为 true,说明不是有效的数独。
2222

23-
## [完整代码][src]
23+
## 实现代码
2424

2525
```java
2626
import java.util.HashSet;
@@ -55,4 +55,4 @@ public class Solution {
5555

5656
[title]: https://leetcode.com/problems/valid-sudoku
5757
[sudoku]: http://sudoku.com.au/TheRules.aspx
58-
[src]: https://github.com/andavid/leetcode-java/blob/master/src/com/andavid/leetcode/_036/Solution.java
58+

note/038/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Output: "1211"
3636
## 思路
3737
遍历字符串,如果当前字符和上一个字符不相同,则输出计数情况,否则计数器加1。
3838

39-
## [完整代码][src]
39+
## 实现代码
4040

4141
```java
4242
class Solution {
@@ -70,4 +70,4 @@ class Solution {
7070
```
7171

7272
[title]: https://leetcode.com/problems/count-and-say
73-
[src]: https://github.com/andavid/leetcode-java/blob/master/src/com/andavid/leetcode/_038/Solution.java
73+

note/048/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ rotate the input matrix in-place such that it becomes:
5353

5454
思路是从外往内,一圈一圈的进行。其中每一圈的每个元素顺时针旋转 90 度,连续操作四次。注意边界,防止重复操作。
5555

56-
## [完整代码][src]
56+
## 实现代码
5757

5858
```java
5959
class Solution {
@@ -73,4 +73,4 @@ class Solution {
7373
```
7474

7575
[title]: https://leetcode.com/problems/rotate-image
76-
[src]: https://github.com/andavid/leetcode-java/blob/master/src/com/andavid/leetcode/_048/Solution.java
76+

note/053/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ If you have figured out the O(n) solution, try coding another solution using the
1919

2020
如果局部最大值大于全局最大值,则进行更新。
2121

22-
## [完整代码][src]
22+
## 实现代码
2323

2424
```java
2525
class Solution {
@@ -40,4 +40,4 @@ class Solution {
4040
```
4141

4242
[title]: https://leetcode.com/problems/maximum-subarray
43-
[src]: https://github.com/andavid/leetcode-java/blob/master/src/com/andavid/leetcode/_053/Solution.java
43+

note/066/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ The digits are stored such that the most significant digit is at the head of the
1212
一个整数按位从高到低依次存储到一个 int 数组中,从数组最后一位开始加 1,如果没有进位,只需修改最后一位即可,否则继续向前进位,如果一直到第一位都有进位,说明全部都是 9,新的数组长度需要加 1,首位是 1,其余位都是 0。
1313
时间复杂度 O(n)。
1414

15-
## [完整代码][src]
15+
## 实现代码
1616

1717
```java
1818
class Solution {
@@ -41,4 +41,4 @@ class Solution {
4141
```
4242

4343
[title]: https://leetcode.com/problems/plus-one
44-
[src]: https://github.com/andavid/leetcode-java/blob/master/src/com/andavid/leetcode/_066/Solution.java
44+

note/070/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Explanation: There are three ways to climb to the top.
3737
爬到第 N 步有两种方法,从 第 N-1 步爬一步,或者从第 N-2 步爬两步。
3838
题目其实就是求斐波那契数列的第 N 个数。
3939

40-
## [完整代码][src]
40+
## 实现代码
4141

4242
```java
4343
class Solution {
@@ -57,4 +57,4 @@ class Solution {
5757
```
5858

5959
[title]: https://leetcode.com/problems/climbing-stairs
60-
[src]: https://github.com/andavid/leetcode-java/blob/master/src/com/andavid/leetcode/_070/Solution.java
60+

note/088/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ You may assume that nums1 has enough space (size that is greater or equal to m +
1919
* 如果是第二个数组的数用完了,剩下的全是数组 1,不用填充了
2020

2121

22-
## [完整代码][src]
22+
## 实现代码
2323

2424
```java
2525
class Solution {
@@ -40,4 +40,4 @@ class Solution {
4040
```
4141

4242
[title]: https://leetcode.com/problems/merge-sorted-array
43-
[src]: https://github.com/andavid/leetcode-java/blob/master/src/com/andavid/leetcode/_088/Solution.java
43+

note/098/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Binary tree `[1,2,3]`, return false.
3434
递归。带上两个参数,分别表示最小值和最大值。
3535
左子树的最大值要小于根节点,右子树的最小值要大于根节点。
3636

37-
## [完整代码][src]
37+
## 实现代码
3838

3939
```java
4040
/**
@@ -64,4 +64,4 @@ class Solution {
6464
```
6565

6666
[title]: https://leetcode.com/problems/validate-binary-search-tree
67-
[src]: https://github.com/andavid/leetcode-java/blob/master/src/com/andavid/leetcode/_098/Solution.java
67+

note/101/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Bonus points if you could solve it both recursively and iteratively.
3636
* 如果左右孩子节点都不为空,但是值不相等,也不是对称的。
3737
* 如果左右孩子节点都不为空,且值相等,如果左孩子节点的左子树与右孩子节点的右子树是对称的,并且左孩子节点的右子树与右孩子节点的左子树是对称的,则二叉树是对称的。
3838

39-
## [完整代码][src]
39+
## 实现代码
4040

4141
```java
4242
/**
@@ -105,5 +105,5 @@ class Solution {
105105
```
106106

107107
[title]: https://leetcode.com/problems/symmetric-tree
108-
[src]: https://github.com/andavid/leetcode-java/blob/master/src/com/andavid/leetcode/_101/Solution.java
108+
109109
[src2]: https://github.com/andavid/leetcode-java/blob/master/src/com/andavid/leetcode/_101/Solution2.java

note/102/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ return its level order traversal as:
3131
* 如果节点不为空,把当前值加到列表,然后把节点的左右孩子节点压入队列尾部(如果孩子节点不为空)
3232
* 如果节点为空,并且队列不为空,则添加当前列表
3333

34-
## [完整代码][src]
34+
## 实现代码
3535

3636
```java
3737
/**
@@ -163,6 +163,6 @@ class Solution {
163163
```
164164

165165
[title]: https://leetcode.com/problems/binary-tree-level-order-traversal
166-
[src]: https://github.com/andavid/leetcode-java/blob/master/src/com/andavid/leetcode/_102/Solution.java
166+
167167
[src2]: https://github.com/andavid/leetcode-java/blob/master/src/com/andavid/leetcode/_102/Solution2.java
168168
[src3]: https://github.com/andavid/leetcode-java/blob/master/src/com/andavid/leetcode/_102/Solution3.java

note/104/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ return its depth = 3.
2323

2424
递归。求二叉树 root 节点左子树和右子树的深度,其中较大的深度加 1 即为二叉树的深度。
2525

26-
## [完整代码][src]
26+
## 实现代码
2727

2828
```java
2929
/**
@@ -67,5 +67,5 @@ class Solution {
6767
```
6868

6969
[title]: https://leetcode.com/problems/maximum-depth-of-binary-tree
70-
[src]: https://github.com/andavid/leetcode-java/blob/master/src/com/andavid/leetcode/_104/Solution.java
70+
7171
[src2]: https://github.com/andavid/leetcode-java/blob/master/src/com/andavid/leetcode/_104/Solution2.java

note/108/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ One possible answer is: [0,-3,9,-10,null,5], which represents the following heig
2626
有序数组的中间作为平衡二叉树的根节点,前半部分作为左子树,后半部分作为右子树。
2727

2828

29-
## [完整代码][src]
29+
## 实现代码
3030

3131
```java
3232
/**
@@ -55,4 +55,4 @@ class Solution {
5555
```
5656

5757
[title]: https://leetcode.com/problems/convert-sorted-array-to-binary-search-tree
58-
[src]: https://github.com/andavid/leetcode-java/blob/master/src/com/andavid/leetcode/_108/Solution.java
58+

note/118/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Return
2222
第 n 行有 n 个数字,第一个和最后一个数字为 1,其余每个数字等于它的左上方与右上方两个数字之和。
2323
因此,可以根据第 n - 1 行得到第 n 行。
2424

25-
## [完整代码][src]
25+
## 实现代码
2626

2727
```java
2828
class Solution {
@@ -52,4 +52,4 @@ class Solution {
5252
```
5353

5454
[title]: https://leetcode.com/problems/pascals-triangle
55-
[src]: https://github.com/andavid/leetcode-java/blob/master/src/com/andavid/leetcode/_118/Solution.java
55+

note/119/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Could you optimize your algorithm to use only O(k) extra space?
1515

1616
如何从第 n-1 行的列表变化到第 n 行的列表?可以从后往前覆盖列表,将列表第 i 个元素的值与第 i-1 个元素的和覆盖到第 i 个元素,最后再添加末尾元素 1 即可。
1717

18-
## [完整代码][src]
18+
## 实现代码
1919

2020
```java
2121
class Solution {
@@ -37,4 +37,4 @@ class Solution {
3737
```
3838

3939
[title]: https://leetcode.com/problems/pascals-triangle-ii
40-
[src]: https://github.com/andavid/leetcode-java/blob/master/src/com/andavid/leetcode/_119/Solution.java
40+

note/121/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ In this case, no transaction is done, i.e. max profit = 0.
2626

2727
题意是给出一个数组代表每天的股票金额,让你在最多买卖一次的情况下算出最大的收益额。思路是遍历一次数组,每次记录当前值减去最小值的差值,与上一次的最大值进行比较然后更新最大值即可。
2828

29-
## [完整代码][src]
29+
## 实现代码
3030

3131
```java
3232
class Solution {
@@ -50,4 +50,4 @@ class Solution {
5050
```
5151

5252
[title]: https://leetcode.com/problems/best-time-to-buy-and-sell-stock
53-
[src]: https://github.com/andavid/leetcode-java/blob/master/src/com/andavid/leetcode/_121/Solution.java
53+

note/122/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Design an algorithm to find the maximum profit. You may complete as many transac
1111

1212
只需要把所有相邻递增的值都加起来即可。
1313

14-
## [完整代码][src]
14+
## 实现代码
1515

1616
```java
1717
class Solution {
@@ -29,4 +29,4 @@ class Solution {
2929
```
3030

3131
[title]: https://leetcode.com/problems/best-time-to-buy-and-sell-stock-ii
32-
[src]: https://github.com/andavid/leetcode-java/blob/master/src/com/andavid/leetcode/_122/Solution.java
32+

0 commit comments

Comments
 (0)