If current value is odd , carry 26 to the next index value
if ( a1 [ i ] & 1 ) { if ( i + 1 <= N ) { a1 [ i + 1 ] += 26 ; } } a1 [ i ] = Math . floor ( a1 [ i ] / 2 ) ; } for ( let i = 1 ; i <= N ; i ++ ) { document . write ( String . fromCharCode ( a1 [ i ] + " " . charCodeAt ( 0 ) ) ) ; } return 0 ; }