@shanmugaveld; thank you for your answer. I was thinking on the lines of current state and next state. That was leading me to nowhere. These type of problems have given me lots of trouble. Do these type of questions have a general approach to get to the solution. Please advice.
Thanks