Company: Morgan stanley_12june
Difficulty: medium
Count Groups with K Unique Genres Problem Description An online streaming company has picked N users who most frequently watched a specific genre, arranged in a fixed order. Each user is given a unique ID from 0 to N-1 . The sales team has stored the most frequently watched genre for each user and must analyse the interest of users in groups , where a group is a block of users with consecutive IDs. Each group must contain users from exactly K different genres. The system must store the count of all possible such groups. Write an algorithm to find the count of all possible groups for analysis. Input The first line of the input consists of an integer - genreList_size , representing the number of users selected (N). The next line consists of N space-separated integers - genreList[0] , genreList[1] , ..., genreList[N-1] , representing the most frequently watched genre for each user. The last line consists of an integer - uniqueGenre , representing the required number of distinct genres in