Advent of Code seems to be very well put together, but I’ve never had a go before. I’ve also been meaning to learn a bit of Kotlin, so I figured I’ll put the two together. At least for one day, no promises on doing all 25.
Part 1 The first problem is here. We’re given a list of depth measurements and need to work out how many measurements increase from the day before....
This implementation is pretty much straight out of the book and we’re required to use the Copy trait as a result, limiting T a great deal.
...
Given a string, find the length of the longest substring without repeating characters.
...
What a great example of an interview question; there are a few levels of difficulty making the problem accessible to many, a fairly obvious naive O(n2) approach with an oportunity for optimisation, and the curious will find that you can do it in O(n) as well. If I ever run another tech interview training course I’ll probably break apart and analyse this problem with the class. It is, however, quite easy and not ideal for an actual interview....
In January 2017 I spoke at NDC London about async arrows. The video is below. Enjoy!