Attempted solution to the Spotify programming puzzles found at https://www.spotify.com/us/jobs/tech/.