Apple interview question

Team related coding question with maths formula.