Yes, I agree with you. Your solution answers OPs question. However, sometimes the question does not cover the problem completely.
As long people know what they want, it’s easier. But that’s not always the case.