as the number is a palindrome , the same swap of digits should be performed in the 2 nd half of 'num
' NEW_LINE INDENT temp = num [ n - i - 1 ] NEW_LINE num [ n - i - 1 ] = num [ n - smallest - 1 ] NEW_LINE num [ n - smallest - 1 ] = temp NEW_LINE DEDENT