Flow of execution

Can anyone tell what will be flow of execution in the first_and_last_position problem ??

A code snippet would really help others to understand what you are asking and also being more specific also helps a lot