Skip to content

Commit

Permalink
Update 0978 solution
Browse files Browse the repository at this point in the history
  • Loading branch information
halfrost committed Nov 24, 2020
1 parent 37fde65 commit 4384f0d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func maxTurbulenceSize1(A []int) int {
flag = lastNum - A[right]
lastNum = A[right]
} else {
if right != left && flag != 0 {
if flag != 0 {
res = max(res, right-left+1)
}
left++
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func maxTurbulenceSize1(A []int) int {
flag = lastNum - A[right]
lastNum = A[right]
} else {
if right != left && flag != 0 {
if flag != 0 {
res = max(res, right-left+1)
}
left++
Expand Down

0 comments on commit 4384f0d

Please sign in to comment.