Skip to content

Instantly share code, notes, and snippets.

@railsstudent
Created November 13, 2016 16:53
Show Gist options
  • Save railsstudent/0b87f2b37505e76e428ca1b1079cd5a8 to your computer and use it in GitHub Desktop.
Save railsstudent/0b87f2b37505e76e428ca1b1079cd5a8 to your computer and use it in GitHub Desktop.
solution = (str) ->
newStr = str
if str.length % 2 is 1 then newStr += '_'
result = []
for i in [0...newStr.length] by 2
result.push (newStr[i..i+1])
result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment