Day 6
Yay - at least part 1 was easy :)
Since Part 1 and Part 2 are near-indentical, bar the number of iterations, I'll post just this code. For Part 1, I'm sure most people (like me) may have just simulated the population levels - a relatively basic program. However, for Part 2, the exponential growth meant I converted to a list that kept track of the counts. The way this works is by keeping track not of the individual fish, but the number of fish on a given number. All my code does is append the number of fish on 0 to the end of the list (to keep track of the 8s) and to add this number also onto the 6 count. Dealing with a small list and medium-sized numbers like this alllowed the runtime to be fast enough!
Please note: due to mock week, my solutions/write ups will be less refined :(