Topic: Dynamic Programming Problem / Level: intermediate

Problem: Find the longest subsequence in an array where adjacent elements are either increasing or decreasing by a constant value using dynamic programming.

Run the code to see the output here...