3 ms·
His solutions works while your does not. I ran them both in irb. This is because "string << integer" does not do what you think it does. It treats the integer a
by jeltz 14y ago
His solutions works while your does not. I ran them both in irb. This is because "string << integer" does not do what you think it does. It treats the integer as character code.
"" << 0x41 # => "A"