Back to DSA sheet

Longest Turbulent Array

MediumGreedy

Read the full statement on LeetCode. A written editorial for this problem is coming soon. Use the editor to solve it, jot notes, and mark it solved.

Sheets
NeetCode 250
longest-turbulent-array.cpp
Loading editor
Custom input (stdin)
Output

Run your code to see its output.