File tree Expand file tree Collapse file tree 2 files changed +3
-10
lines changed
src/0376.Wiggle-Subsequence Expand file tree Collapse file tree 2 files changed +3
-10
lines changed Original file line number Diff line number Diff line change @@ -36,14 +36,13 @@ Output: 2
3636## 题意
3737> 求摇摆序列最长序列,可以转化为数组【上升】【下降】状态的转换
3838
39- <a href =" https://github.com/kylesliu/awesome-golang-leetcode/tree/master/assets/images/376_Wiggle_Subsequence.jpg " >
40- <img src="https://github.com/kylesliu/awesome-golang-leetcode/tree/master/assets/images/376_Wiggle_Subsequence.jpg" />
41- </a >
4239
4340## 题解
4441
4542### 思路1
46- > 按照小学算数那么来做,用 ` carry ` 表示进位,从后往前算,依次往前,每算出一位就插入到最前面即可,直到把两个二进制串都遍历完即可。
43+ > 分别定义上升下降2个状态,分别做判断
44+
45+ ![ 376_Wiggle_Subsequence] ( ../../assets/images/376_Wiggle_Subsequence.jpg )
4746
4847``` go
4948func wiggleMaxLength (nums []int ) int {
@@ -83,12 +82,6 @@ func wiggleMaxLength(nums []int) int {
8382
8483```
8584
86- ### 思路2
87- > 思路2
88- ``` go
89-
90- ```
91-
9285## 结语
9386
9487如果你同我一样热爱数据结构、算法、LeetCode,可以关注我 GitHub 上的 LeetCode 题解:[ awesome-golang-leetcode] [ me ]
You can’t perform that action at this time.
0 commit comments