mirror of
https://github.com/youngyangyang04/leetcode-master.git
synced 2025-07-11 21:10:58 +08:00
更新 0135.分发糖果 排版格式修复
This commit is contained in:
@ -28,9 +28,9 @@
|
|||||||
* 输出: 4
|
* 输出: 4
|
||||||
* 解释: 你可以分别给这三个孩子分发 1、2、1 颗糖果。第三个孩子只得到 1 颗糖果,这已满足上述两个条件。
|
* 解释: 你可以分别给这三个孩子分发 1、2、1 颗糖果。第三个孩子只得到 1 颗糖果,这已满足上述两个条件。
|
||||||
|
|
||||||
# 视频讲解
|
## 算法公开课
|
||||||
|
|
||||||
**《代码随想录》算法视频公开课:[贪心算法,两者兼顾很容易顾此失彼!LeetCode:135.分发糖果](https://www.bilibili.com/video/BV1ev4y1r7wN),相信结合视频在看本篇题解,更有助于大家对本题的理解**。
|
**[《代码随想录》算法视频公开课](https://programmercarl.com/other/gongkaike.html):[贪心算法,两者兼顾很容易顾此失彼!LeetCode:135.分发糖果](https://www.bilibili.com/video/BV1ev4y1r7wN),相信结合视频在看本篇题解,更有助于大家对本题的理解**。
|
||||||
|
|
||||||
|
|
||||||
## 思路
|
## 思路
|
||||||
@ -234,7 +234,7 @@ func findMax(num1 int, num2 int) int {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Javascript:
|
### Javascript
|
||||||
```Javascript
|
```Javascript
|
||||||
var candy = function(ratings) {
|
var candy = function(ratings) {
|
||||||
let candys = new Array(ratings.length).fill(1)
|
let candys = new Array(ratings.length).fill(1)
|
||||||
@ -376,3 +376,4 @@ object Solution {
|
|||||||
<a href="https://programmercarl.com/other/kstar.html" target="_blank">
|
<a href="https://programmercarl.com/other/kstar.html" target="_blank">
|
||||||
<img src="../pics/网站星球宣传海报.jpg" width="1000"/>
|
<img src="../pics/网站星球宣传海报.jpg" width="1000"/>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user