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 in a pre-defined sequence. 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 in the system and must analyse the interest of users in groups so that each group has users with consecutive IDs. Each group must contain users from exactly K different genres. The system must store the count of all the possible 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 the users. The last line consists of an integer - uniqueGenre , representing the unique genres in a group for analy