Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Great solution
I like how you used the index i of the for loop as a time unit to determine the state of the traffic lights.
With this solution you are always able to tell the current state for each given point of time instead of cycling through the states one by one.
Would have wished for some more descriptive variables and some code extraction into little functions, but you already mentioned that.
Great solution, learned something new.