Last active
May 12, 2017 03:09
-
-
Save justinko/bed3e101d3d7d46f318c0df0946397fe to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def merge_string(a, b) | |
[a, b].map(&:size).max.times.with_object('') do |(index), output| | |
[a, b].each {|var| output << (var[index] || '') } | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment