Split Strings
1.题目描述
Complete the solution so that it splits the string into pairs of two characters. If the string contains an odd number of characters then it should replace the missing second character of the final pair with an underscore (‘_‘).
Examples:
1 | * 'abc' => ['ab', 'c_'] |
2.我的解法:
1 | function solution(str) { |
3.学习到的解法:
1 | function solution(s) { |