LogoWCF

Day 18: The Good Ol' Days

Santa found an old map he used to use that shows the path he took around to several places.

Problem: He wants to find out how many cities he used to cross over. The map is rough and only shows the number of close by cities and whenever Santa turned his sleigh.

Santa always flew from North to South, so he started at the top of the map and worked his way down. All numbers are interpreted as single digits even if they are right next to other numbers. Santa’s moves are shown with <, >, ^, and v. Starting at the top, follow the steps and count the number of cities Santa used to fly over.

Here’s an example map.

.5v......2
..>.8..v.3
..7....>.v
9..v...96<
...4.....2

Santa started near the North-West corner and went down, then went East 5 spaces flying over 8 cities. Then he went down again and East 2 spaces, then down and West 6 spaces flying over 15 (6 + 9) cities. Finally he went down and flew over 4 cities. That’s a total of 27 (8+6+9+4) cities.

Solutions