Internationalization Puzzles

No user set, Login with GitHub Login with Google scoreboard

A trip around the world.

The novel ‘Around the world in 80 days’ by Jules Verne tells the story of Phileas Fogg, an eccentric Englishman who speedruns a trip around the world following a daring bet. He is accompanied by his servant Passepartout. The book was published in 1872. Like every good science fiction author, Jules Verne took ideas from the cutting edge of science at the time, and worked it into a thrilling story. And the new idea was this: that it was possible to notice the difference between time zones, something that was made possible by the mechanization of transport. Here is an excerpt from the book, where we see Passepartout being completely baffled by this effect:

“You have plenty of time; it’s only twelve o’clock.”

Passepartout pulled out his big watch. “Twelve!” he exclaimed; “why, it’s only eight minutes before ten.”

“Your watch is slow.”

“My watch? A family watch, monsieur, which has come down from my great-grandfather! It doesn’t vary five minutes in the year. It’s a perfect chronometer, look you.”

“I see how it is,” said Fix. “You have kept London time, which is two hours behind that of Suez. You ought to regulate your watch at noon in each country.”

“I regulate my watch? Never!”

“Well, then, it will not agree with the sun.”

“So much the worse for the sun, monsieur. The sun will be wrong, then!”

Those time differences lead to a major plot twist. Go read the book if you want to know how…

Suppose you follow a similar round-the-world itinerary. This itinerary is your puzzle input. It lists a sequence of departures and arrivals, starting from London, taking you around the world, and back again to London. You travel from place to place by airplane or high-speed train. For each place, the name of the continent is listed as well, to help you with any hiatus in your knowledge of topography. As is the habit of airlines and travel agencies, all arrival and departure times are printed in local time.

Write a program that calculates the total travel time in minutes, of the input itinerary. How many minutes would you be spending inside a train or airplane?

For example, take the following test input:

Departure: Europe/London                  Mar 04, 2020, 10:00
Arrival:   Europe/Paris                   Mar 04, 2020, 11:59

Departure: Europe/Paris                   Mar 05, 2020, 10:42
Arrival:   Australia/Adelaide             Mar 06, 2020, 16:09

Departure: Australia/Adelaide             Mar 06, 2020, 19:54
Arrival:   America/Argentina/Buenos_Aires Mar 06, 2020, 19:10

Departure: America/Argentina/Buenos_Aires Mar 07, 2020, 06:06
Arrival:   America/Toronto                Mar 07, 2020, 14:43

Departure: America/Toronto                Mar 08, 2020, 04:48
Arrival:   Europe/London                  Mar 08, 2020, 16:52

Note that on the trip from Paris to Adelaide, your arrival is on a day after the departure. It’s also possible to have an arrival one day earlier, if you cross the date line, and your timing is right.

The sum of travel time in minutes is then 3143 minutes, so 3143 would be the answer to the test-input.

Reading & reference materials


You must be logged in to get the puzzle input and submit answers