LeetCode solutions, medium, 978, Longest Turbulent Subarray