Agoda interview question

leetcode 1395. Count Number of Teams