Accenture Interview Question

aptitude and psuedocode