Created
December 13, 2012 18:53
-
-
Save Yardboy/4278677 to your computer and use it in GitHub Desktop.
Splitting into three, splitting into four.
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
# Let's say you have a collection of seven items: | |
['a', 'b', 'c', 'd', 'e', 'f', 'g'] | |
# and you want to split it into three groups. What should the result be? | |
A. | |
[ | |
['a', 'b', 'c'], | |
['d', 'e'], | |
['f', 'g'] | |
] | |
# or | |
B. | |
[ | |
['a', 'b', 'c'], | |
['d', 'e', 'f'], | |
['g'] | |
] | |
# Likewise, when splitting a collection of 10 items into four groups, should the result be: | |
C. | |
[ | |
['a', 'b', 'c'], | |
['d', 'e', 'f'], | |
['g', 'h'], | |
['i', 'j'] | |
] | |
# or | |
D. | |
[ | |
['a', 'b', 'c'], | |
['d', 'e', 'f'], | |
['g', 'h', 'i'], | |
['j'] | |
] | |
# I realize there is an aspect of "it depends on what you're doing" here, but give me your "general-case" gut feeling. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment