Pregunta de entrevista de Apple

Team related coding question with maths formula.