As each location is checked, they may mark it on their list with a star. They figure the Chief Historian have to be in one in every of the primary fifty places they’ll look, so as a way to save Christmas, you could help them get fifty stars on their list before Santa takes off on December twenty fifth.
Collect stars by solving puzzles. Two puzzles will likely be made available on every day within the Advent calendar; the second puzzle is unlocked whenever you complete the primary. Each puzzle grants one star. Good luck!
You have not even left yet and the group of Elvish Senior Historians has already hit an issue: their list of locations to ascertain is currently empty. Eventually, someone decides that one of the best place to ascertain first can be the Chief Historian’s office.
Upon pouring into the office, everyone confirms that the Chief Historian is indeed nowhere to be found. As a substitute, the Elves discover an assortment of notes and lists of historically significant locations! This appears to be the planning the Chief Historian was doing before he left. Perhaps these notes will be used to find out which locations to look?
Throughout the Chief’s office, the historically significant locations are listed not by name but by a novel number called the placement ID. To be sure they do not miss anything, The Historians split into two groups, each searching the office and attempting to create their very own complete list of location IDs.
There’s only one problem: by holding the 2 lists up side by side (your puzzle input), it quickly becomes clear that the lists aren’t very similar. Perhaps you may also help The Historians reconcile their lists?
For instance:
3 4
4 3
2 5
1 3
3 9
3 3
Perhaps the lists are only off by a small amount! To seek out out, pair up the numbers and measure how far apart they’re. Pair up the smallest number within the left list with the smallest number in the proper list, then the second-smallest left number with the second-smallest right number, and so forth.
Inside each pair, work out how far apart the 2 numbers are; you’ll have so as to add up all of those distances. For instance, when you pair up a 3 from the left list with a 7 from the proper list, the space apart is 4; when you pair up a 9 with a 3, the space apart is 6.
In the instance list above, the pairs and distances can be as follows:
The smallest number within the left list is 1, and the smallest number in the proper list is 3. The gap between them is 2.
The second-smallest number within the left list is 2, and the second-smallest number in the proper list is one other 3. The gap between them is 1.
The third-smallest number in each lists is 3, so the space between them is 0.
The subsequent numbers to pair up are 3 and 4, a distance of 1.
The fifth-smallest numbers in each list are 3 and 5, a distance of two.
Finally, the biggest number within the left list is 4, while the biggest number in the proper list is 9; these are a distance 5 apart.
To seek out the overall distance between the left list and the proper list, add up the distances between the entire pairs you found. In the instance above, that is 2 + 1 + 0 + 1 + 2 + 5, a complete distance of 11!
Your actual left and right lists contain many location IDs. What’s the overall distance between your lists?
### Solution: 1666427