Accenture Interview Question

pseudo code based on coding