Topic: Dynamic Programming Problem / Level: beginner

Problem: Compute the longest alternating subsequence in an array.

Run the code to see the output here...