Day 87 - Coaching and uSwitch dojo
Cycled on my Brompton folding bike for another coaching session in Wagamama on the Southbank. The restaurant was not busy and it was quiet enough to discuss 4Clojure solutions in details.
Wagamama also has some very healthy food and I found it a relaxing way to learn and teach Clojure. I enjoyed my Vegatsu dish with extra curry sauce.
Then a short ride over to uSwitch offices just past Tower Bridge (South side) for the London Clojurians Code dojo event.
Code from today:
Coaching session - 4Clojure #41λ︎
Challenge #41 is quite a fun one.
Looking at the first and last test of the challenge we are given a sequential set of numbers, so it seems you could just write a filter function (or remove) and a specific function to only return the right values.
The middle test uses keywords, so there is no uniform way of removing elements of the collection based on their value.
Instead we have to do remove elements by position (so following the spirit of nth).
Once you discover the partition function the problem becomes much easier to solve, as you can group the elements by their position in the collection. You can also step through a collection at a size different to the partition size you want to create.
With a partition of 2 and a step of 3 we can quickly get the shape of data we wanted.
Then its just a case of tidying up the data to match the result using the ~flatten~ function.
4Clojure #41 - Drop every nth item
Clojure dojo - Advent of Code day 9λ︎
Collective approach to solving the day 9 challenge of the Advent of Code.
There was a lot of discussion around what the challenge actually was and the different ways to solve it.
There were possibly a few too many people in our group and although this did lead to some very interesting discussions, we didn't get around to actually solving the problem fully.
Two versions of the solution were added to the practicalli-johnny/advent-of-code-2018 repository
Thank you.