Skip to main content
100%

Using Ruby, sort each coach by consecutive season tenures. Some seasons have two coaches which implies that the coach was fired/removed mid-season. The result should be something like [[name, start_season, end_season], [name, start_season, end_season]] where the order is by ascending start_season.

✓ Published0🌍 Public
CCaged
Last edited May 7, 2016
Created on May 7, 2016

This example visualizes the consecutive tenures of each coach from the `coaches.csv` gist, ordering tenures by ascending start season and representing mid-season firings when a season lists two coaches. It shows a clean chronological timeline of coaching stints, with each row as a `[name, start_season, end_season]` tuple, computed using Ruby’s `CSV` and `Enumerable#sort_by` to group and sort the data. The rendering relies on Ruby’s standard `CSV` parsing and array manipulation to extract and order the seasons, then outputs the structured list without external charting libraries.

AI-generated description

Similar vizzes