yes ..your sequence is right..
My Solution:-
https://gateoverflow.in/?qa=blob&qa_blobid=3249692619552691394
64.3k questions
77.9k answers
243k comments
79.7k users