sol to the question
test cases