6 kyu
Alternating Loops
557 of 1,454joh_pot
Description:
Write
def combine()
that combines arrays by alternatingly taking elements passed to it.
E.g
combine(['a', 'b', 'c'], [1, 2, 3]) == ['a', 1, 'b', 2, 'c', 3]
combine(['a', 'b', 'c'], [1, 2, 3, 4, 5]) == ['a', 1, 'b', 2, 'c', 3, 4, 5]
combine(['a', 'b', 'c'], [1, 2, 3, 4, 5], [6, 7], [8]) == ['a', 1, 6, 8, 'b', 2, 7, 'c', 3, 4, 5]
Arrays can have different lengths.
Fundamentals
Algorithms
Similar Kata:
Stats:
Created | Sep 1, 2015 |
Published | Sep 1, 2015 |
Warriors Trained | 2717 |
Total Skips | 116 |
Total Code Submissions | 5119 |
Total Times Completed | 1454 |
JavaScript Completions | 704 |
Ruby Completions | 131 |
Python Completions | 557 |
Haskell Completions | 123 |
Total Stars | 71 |
% of votes with a positive feedback rating | 95% of 291 |
Total "Very Satisfied" Votes | 267 |
Total "Somewhat Satisfied" Votes | 21 |
Total "Not Satisfied" Votes | 3 |