Day 1 - West Yellowstone Entrance
Due to overcrowding, the National Park Service runs a lottery of sorts to enter the park. The lottery is based on several conditions:
- license plate number (AZ - Arizona, CA - California, ID - Idaho, MT - Montana, NM - New Mexico, NV - Nevada, OR - Oregon, UT - Utah, WA - Washington)
- license plate state
- order in line
- has annual pass
On the day that you enter the park, the cars are allowed in in the following order during the first hour:
- All cars from Utah.
- All cars with an annual pass.
- License plates that start with āYā.
- Move the first 47 cars to the end of the line.
- Every tenth car. Number the cars starting at 1. Let in cars number 10, 20, 30, etc.
- License plates that start with āPā.
There are 200 cars in the test input file. The numbers of cars left in line after each step are 179, 86, 83, 83, 75, and 70.
At the end of the hour, how many cars are still in line?
Input
Test input
Hints
Copyright 2022 Robin A. Reynolds-Haertle