TIME O(n)空間 O(1):只留 up、down、ans
01 / 折線上的兩條鏈INITIALIZE
i—
比較—
up—
down—
ans—
折線圖
每個點是 arr[i];藍線上升、紅線下降,發光的是目前的震盪鏈
up
down
ans
STEP 01