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