Topic: Dynamic Programming Problem / Level: beginner

Problem: Compute the longest zigzag subsequence in an array where the elements alternately increase and decrease using dynamic programming.

Run the code to see the output here...