CodingReported in a candidate post, Apr 2024
Longest alternating subsequence
Filed under CodingMart
The question
Return the longest subsequence whose elements alternate between greater and smaller than the previous element.
No write-up yet. Related questions below have one.
Related CodingMart questions
Collected from public candidate posts and coding forums. Updated Nov 2026.