diff --git a/6kyu/break_camel_case/solution.rb b/6kyu/break_camel_case/solution.rb new file mode 100644 index 0000000..fb332e8 --- /dev/null +++ b/6kyu/break_camel_case/solution.rb @@ -0,0 +1,9 @@ +def solution(string) + string.chars.map { |c| + if c == c.upcase + " " + c + else + c + end + }.join +end diff --git a/README.md b/README.md index cebbbfa..fd9f3ab 100644 --- a/README.md +++ b/README.md @@ -214,6 +214,10 @@ - [Detect Pangram](https://www.codewars.com/kata/545cedaa9943f7fe7b000048) - [solution](6kyu/detect_pangram) +### Ruby + +- [Break camelCase](https://www.codewars.com/kata/5208f99aee097e6552000148) - [solution](6kyu/break_camel_case) + ## 7 kyu ### JS