Example. Sample Input: [2, 3, 4, 1, 7, 9] Sample Output: Yes. Explanation: It has a set of contiguous integers of the number [2, 3, 4, 1] Algorithm to check if the array contains contiguous integers with duplicates allowed 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 elements in the subsequence equals difference.