Pergunta de entrevista da empresa Apple

Not difficult or anything unexpected