My solution to the CodinGame challenge Racing Horces: