Function that returns the maximum length subsequence such that adjacent elements have a common factor .
int maxLengthSubsequence ( int arr [ ] , int n ) { int dp [ N ] ; unordered_map < int , int > pos ;