if elements are similar so for making a pair we toggle any of them . Since toggle cost is 1 so overall weight gain becomes 3
else : NEW_LINE INDENT ans = max ( 3 + getMaxRec ( string , i + 2 , n , lookup ) , ans ) NEW_LINE DEDENT