Find the farthest index needed to change on right side
for i in range ( pos , n // 2 ) : NEW_LINE INDENT if ( strr [ i ] != strr [ n - i - 1 ] ) : NEW_LINE INDENT right = i NEW_LINE DEDENT DEDENT ans = 0 NEW_LINE for i in range ( left , right + 1 ) : NEW_LINE