Accenture interview question

pseudo code based on coding