Skip to content

Commit f85a18f

Browse files
committed
update
1 parent 82d8964 commit f85a18f

7 files changed

+69
-18
lines changed

LeetCode/0001.两数之和.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
## leetcode-0001-题解
2+
3+
地址:<https://leetcode-cn.com/problems/two-sum/>
4+
5+
6+
7+
## Java版
8+
9+
1、暴力解法:
10+
11+
``` java
12+
public class Solution {
13+
public int[] twoSum(int[] nums, int target) {
14+
for (int i = 0; i < nums.length; i++) {
15+
for (int j = i+1; j < nums.length; j++) {
16+
if (nums[j] == target - nums[i]) {
17+
return new int[] {i, j};
18+
}
19+
}
20+
}
21+
throw new IllegalArgumentException("No two sum solution");
22+
}
23+
```
24+
25+
26+
27+
## Python
28+
29+
1、暴力解法:
30+
31+
``` python
32+
class Solution:
33+
def twoSum(self, nums, target):
34+
n = len(nums)
35+
for i in range(n):
36+
for j in range(i+1, n):
37+
if nums[j] == (target - nums[i]):
38+
return [i, j]
39+
raise Exception("No two sum solution")
40+
41+
42+
if __name__ == '__main__':
43+
nums = [2, 7, 11, 15]
44+
target = 26
45+
solution = Solution()
46+
result = solution.twoSum(nums, target)
47+
print(result)
48+
```
49+

LeetCode/0002.两数相加.md

Whitespace-only changes.

LeetCode/0003.无重复字符的最长子串.md

Whitespace-only changes.

README.md

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,27 @@
11
# 数据结构与算法学习
22
记录数据结构与算法的学习过程、LeetCode刷题,为大厂努力...
33

4+
数据结构
5+
---
46

7+
-
58

69
## LeetCode
710

8-
- LeetCode 官网<https://leetcode.com/>
11+
- LeetCode(英文)<https://leetcode.com/>
912
- 题库:<https://leetcode.com/problemset/all/>
10-
- LeetCode 中国<https://leetcode-cn.com/> - 和 LeetCode 官网差不多,使用这个网站即可
13+
- LeetCode(中文)<https://leetcode-cn.com/> - 使用该网站即可
1114
- 题库: <https://leetcode-cn.com/problemset/all/> 【荐】(直接进去刷题)
12-
- 牛客网在线编程<https://www.nowcoder.com/activity/oj>
15+
- 牛客网<https://www.nowcoder.com>
1316

14-
Leetcode 刷题笔记:
17+
Leetcode 刷题笔记 - 见 LeetCode 目录
1518

19+
- [1.两数之和 (Two Sum)](./LeetCode/0001.两数之和.md)
20+
- [2.两数相加 (Add Two Numbers)](./LeetCode/0002.两数相加.md)
21+
- [3.无重复字符的最长子串 (Longest Substring Without Repeating Characters)](./LeetCode/0003.无重复字符的最长子串.md)
1622
-
1723

18-
19-
20-
## 数据结构
21-
22-
-
23-
24-
25-
26-
24+
2725

2826
## 学习资料
2927

@@ -32,6 +30,12 @@ Leetcode 刷题笔记:
3230
资料收集:
3331

3432

33+
- [CyC2018/CS-Notes](<https://github.com/CyC2018/CS-Notes>) - 含 Leetcode 题解。
34+
35+
- [MisterBooo/LeetCodeAnimation](https://github.com/MisterBooo/LeetCodeAnimation)
36+
37+
> Demonstrate all the questions on LeetCode in the form of animation.(用动画的形式呈现解LeetCode题目的思路)
38+
3539
- [azl397985856/leetcode](<https://github.com/azl397985856/leetcode>)
3640

3741
> LeetCode Solutions: A Record of My Problem Solving Journey.( leetcode题解,记录自己的leetcode解题之路。)
@@ -44,10 +48,6 @@ Leetcode 刷题笔记:
4448

4549
> LeetCode题解,151道题完整版
4650
47-
- [MisterBooo/LeetCodeAnimation](https://github.com/MisterBooo/LeetCodeAnimation)
48-
49-
> Demonstrate all the questions on LeetCode in the form of animation.(用动画的形式呈现解LeetCode题目的思路)
50-
5151
- 左耳朵耗子-陈皓:[haoel/leetcode](https://github.com/haoel/leetcode)
5252

5353
> LeetCode Problems' Solutions
@@ -60,11 +60,13 @@ Leetcode 刷题笔记:
6060

6161
- 《算法图解》
6262
- 《我的第一本算法书》
63+
- 《算法》(第四版)
64+
- 《大话数据结构》
6365
-
6466

6567
视频:
6668

67-
- 花花酱LeetCode 视频:[Bilibili 传送门](<https://space.bilibili.com/9880352/channel/index>) | [YouTube 传送门](<https://www.youtube.com/user/xxfflower/playlists>)
69+
- 花花酱 LeetCode 视频:[Bilibili 传送门](<https://space.bilibili.com/9880352/channel/index>) | [YouTube 传送门](<https://www.youtube.com/user/xxfflower/playlists>)
6870
- bobo老师:[深度实战玩转算法-慕课网实战](https://coding.imooc.com/class/138.html)
6971

7072
网站:
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)