Topic: Dynamic Programming Problem / Level: intermediate

Problem: Find the longest subsequence where adjacent elements have a difference of exactly 1 using dynamic programming.

Run the code to see the output here...