Pergunta de entrevista da empresa Student Beans

How to solve a coding challenge