Created
August 1, 2017 23:39
-
-
Save managedkaos/bcc1366c4ac31ca3d1e020ad35b8f32b to your computer and use it in GitHub Desktop.
Rockin' Robin from Code Wars https://www.codewars.com/kata/580ee4f2df9127927c0000be
This file contains 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
arrays = [ [1,7], [2,3,4], [10,11,12,13] ] | |
while arrays: | |
for (index, item) in enumerate(arrays): | |
if len(arrays[index]) == 0: | |
arrays.pop(index) | |
continue | |
print arrays[index].pop(0) | |
print arrays |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Visualizing the array shrinkage: