Function that returns the maximum length subsequence such that adjacent elements have a common factor .
def maxLengthSubsequence ( arr , n ) : NEW_LINE INDENT dp = [ 1 for i in range ( N + 1 ) ] NEW_LINE pos = dict ( ) NEW_LINE DEDENT