Is this how you solve this question?

I got right answer. But skeptical about the procedure.