When Jack was born, his parents listed down 1000 distinct times from 0 to 1000000, in hours since birth, and they also gathered 1000 timers.
When each specified hour on the list of times passed, Jack started a timer. Each timer starts at 0 and counts up 1 hour for every hour that passes. However, many of the timers are defective, and remain at 0 no matter how many hours pass.
For the purposes of this question, "current time" refers to the number of hours since Jack's birth. Jack wants to find the current time. Unfortunately, he forgot to associate each timer with a time. Given the initial list of 1000 times his parents created and the 1000 times on the timers, find the last three digits of the current time.
Sample input (with only 4 times)
The list of times is . The list of timer times is .
Answer and explanation
The current time is . The must be associated with the , and the with the . One timer showing hasn't been started yet, and the other timer showing is associated with , but is defective. Any other current time would not match up with the times on the timers.
Note that the actual input has 1000 times and 1000 timer times.
Details and assumptions
You may find the required numbers here. The first 1000 lines is the list of times, in numerical order, and the next 1000 lines are the times on the timers, in no particular order.
You may assume the current time is uniquely determined by the time on the timers.