Pergunta de entrevista da empresa EGYM

An data structure coding problem to solve in Google docs.