For each start position, find the shortest run of students covering every talent.
Unlock detailed company stats for this questionUpgrade
Students have talents 1..talentsCount. A team must be consecutive students covering every talent. For each starting position, return the minimum number of students needed for a valid team, or -1 if impossible. Example: talentsCount=3, talent=[1,2,3,2,1] -> [3,4,3,-1,-1]. Constraints: 1 <= n, talentsCount <= 10^5.
Format · Expedia SDE-2 OA, question 3 (medium).
Community answers
No answers contributed by the community yet.
Related courses

Course

Course
Course
