This program is written in Ruby. If you have ruby installed, cd
into this directory and type ruby limebike.rb
. You should see output in the console.
I used the sample data provided and ran from there. This program uses O(n^2 - 1) complexity. I realized that the first imput was set in stone, so you subtract one for that. I'm sure there's a more efficient way of solving this problem, but I'm not as well-versed in making algorithms as I am in general iOS programming.