Add numbers to res upto size of str and then add number reverse to it
for ( int i = 1 ; i <= len ; i ++ ) res += Integer . toString ( i ) ; for ( int i = len - 1 ; i >= 1 ; i -- ) res += Integer . toString ( i ) ; return res ; }