Skip to content

Commit c972e16

Browse files
fly0o0ygy
andauthored
feat: 增加公司标签,字节、bat (azl397985856#415)
Co-authored-by: ygy <ygy@duiba.com.cn>
1 parent 15e1fa4 commit c972e16

File tree

168 files changed

+941
-11
lines changed

Some content is hidden

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

168 files changed

+941
-11
lines changed

problems/101.symmetric-tree.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,14 @@ https://leetcode-cn.com/problems/symmetric-tree/
3636

3737
## 公司
3838

39+
- 阿里
40+
- 腾讯
41+
- 百度
42+
- 字节
3943
- bloomberg
4044
- linkedin
4145
- microsoft
46+
4247
## 前置知识
4348

4449
- [二叉树](https://github.com/azl397985856/leetcode/blob/master/thinkings/basic-data-structure.md)

problems/1011.capacity-to-ship-packages-within-d-days-cn.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ https://leetcode-cn.com/problems/capacity-to-ship-packages-within-d-days
5151

5252
- 二分法
5353

54+
## 公司
55+
56+
- 阿里
57+
5458
## 思路
5559

5660
这道题和[猴子吃香蕉](https://github.com/azl397985856/leetcode/blob/master/problems/875.koko-eating-bananas.md) 简直一摸一样,没有看过的建议看一下那道题。

problems/1014.best-sightseeing-pair.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ https://leetcode-cn.com/problems/best-sightseeing-pair/description/
2525

2626
- 动态规划
2727

28+
## 公司
29+
30+
- 阿里
31+
- 字节
32+
2833
## 思路
2934

3035
最简单的思路就是两两组合,找出最大的,妥妥超时,我们来看下代码:

problems/1015.smallest-integer-divisible-by-k.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ https://leetcode-cn.com/problems/smallest-integer-divisible-by-k/description/
3838

3939
- 循环节
4040

41+
## 公司
42+
43+
- 暂无
44+
4145
## 思路
4246

4347
这道题是说给定一个 K 值,能否找到一个形如 1,11,111,1111 。。。 这样的数字 n 使得 n % K == 0。

problems/1019.next-greater-node-in-linked-list.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ https://leetcode-cn.com/problems/next-greater-node-in-linked-list/submissions/
4040
- 链表
4141
-
4242

43+
## 公司
44+
45+
- 腾讯
46+
- 字节
47+
4348
## 思路
4449

4550
看完题目就应该想到单调栈才行,LeetCode 上关于单调栈的题目还不少,难度都不小。但是一旦你掌握了这个算法,那么这些题目对你来说都不是问题了。

problems/102.binary-tree-level-order-traversal.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,13 @@ https://leetcode.com/problems/binary-tree-level-order-traversal/description/
2929

3030
- 队列
3131

32+
## 公司
33+
34+
- 阿里
35+
- 腾讯
36+
- 百度
37+
- 字节
38+
3239
## 思路
3340

3441
这是一个典型的二叉树遍历问题, 关于二叉树遍历,我总结了一个[专题](https://github.com/azl397985856/leetcode/blob/master/thinkings/binary-tree-traversal.md),大家可以先去看下那个,然后再来刷这道题。

problems/1020.number-of-enclaves.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,10 @@ class Solution:
104104

105105
## 解法二 (消除法)
106106

107+
## 公司
108+
109+
- 暂无
110+
107111
### 思路
108112

109113
上面的解法时间复杂度和空间复杂度都很差,我们考虑进行优化, 这里我们使用消除法。

problems/1023.camelcase-matching.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ https://leetcode-cn.com/problems/camelcase-matching/
4747

4848
- 双指针
4949

50+
## 公司
51+
52+
- 暂无
53+
5054
## 思路
5155

5256
这道题是一道典型的双指针题目。不过这里的双指针并不是指向同一个数组或者字符串,而是指向多个,这道题是指向两个,分别是 query 和 pattern,这种题目非常常见,能够识别和掌握这种题目的解题模板非常重要。对 queries 的每一项我们的逻辑是一样的,这里就以其中一项为例进行讲解。

problems/103.binary-tree-zigzag-level-order-traversal.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ return its zigzag level order traversal as:
2727

2828
- 队列
2929

30+
## 公司
31+
32+
- 阿里
33+
- 腾讯
34+
- 百度
35+
- 字节
36+
3037
## 思路
3138

3239
这道题可以借助`队列`实现,首先把root入队,然后入队一个特殊元素Null(来表示每层的结束)。

problems/1031.maximum-sum-of-two-non-overlapping-subarrays.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ L + M <= A.length <= 1000
4141

4242
- 数组
4343

44+
## 公司
45+
46+
- 字节
47+
4448
## 思路(动态规划)
4549

4650
题目中要求在前N(数组长度)个数中找出长度分别为L和M的非重叠子数组之和的最大值, 因此, 我们可以定义数组A中前i个数可构成的非重叠子数组L和M的最大值为SUMM[i], 并找到SUMM[i]和SUMM[i-1]的关系, 那么最终解就是SUMM[N]. 以下为图解:

0 commit comments

Comments
 (0)