Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
insort_left solution in Clear category for The Ship Teams by flpo
from bisect import insort_left
def two_teams(sailors):
ships = [[],[]]
for sailor, age in sailors.items():
insort_left(ships[20 <= age <= 40], sailor)
return ships
Sept. 1, 2018
Comments: