Finding Out the Longest Arithmetic Subsequence of Given Difference using Dynamic Programming Algorithm
Given an integer array arr and an integer difference, return the length of the longest subsequence in arr which is an arithmetic sequence such that the difference between adjacent …