Topic: Dynamic Programming Problem / Level: beginner

Problem: Solve the problem of finding the longest alternating subsequence in an array.

Run the code to see the output here...