I think that this problem is easy enough to try to make the solution as efficient as possible.
My consideration notes: 1. You can make it without using arrays, because the local information that you get is enough to generate the answer. 2. I think that it is worth trying to make the speaking variable names. It will certainly require additional time, but I think, it should pay off in the future.