pass all test cases
add comments for sol
sol of q143