Pergunta de entrevista da empresa Apple

Team related coding question with maths formula.