結果 : minimum distance hackerrank solution in python