This is a verified interview question from Atlassian. Candidates reporting seeing this problem in recent Online Assessments (OAs) and onsite rounds. Mastering "Forming Teams for Quiz Competition - Atlassian Online Assessment" covers key patterns like Arrays.
"A class has students with various talents, each represented by an integer from 1 to talentsCount. You need to form teams for a quiz competition, where each team must have at least one member with each talent. Teams must be formed from consecutive students in the array. For each possible starting position, determine the minimum number of students needed to form a valid team. If it is not possible to form a team with all talents from a particular starting position, return -1 for that position. "
Join thousands of developers practicing for Atlassian.