Pergunta de entrevista da empresa Softwire

Pseudo- coding, very logic based