Properly calculating the min number of jumps (super inefficiently and without regard to security)