Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- allKids = gets.chomp
- numOfTeams = gets.to_i
- kids = allKids.split(', ')
- numOfTeams.times do |i|
- r = "Team #{i + 1}: "
- (i...kids.length).step(numOfTeams) do |j|
- r += "#{kids[j]}, "
- end
- r = r[0...-2]
- puts r
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement