Created
November 13, 2016 16:53
-
-
Save railsstudent/0b87f2b37505e76e428ca1b1079cd5a8 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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