Yes.
Your solution is a correct way to solve it. There is more than one correct way.
9.4m questions
12.2m answers