Company: KLA
Difficulty: medium
\n C++: The Event \n \n \n A major event is taking place at a mall with multiple entry gates. Attendees arrive with friends and specify the gate they will use. \n \n You have two integer arrays of length n: \n \n friends : Represents the number of friends each attendee is bringing. \n gates : Represents the gate each attendee will enter. \n \n \n Determine the total number of people entering through each gate. \n \n\n \n Function Description \n Complete the function getGatesCount in the editor below. \n\n Function Parameters \n \n int friends[n] : friends[i] denotes the number of friends accompanying the i th attendee \n int gates[n] : gates[i] indicates the gate through which the i th attendee and their friends enter \n int m : the number of gates \n \n\n Returns \n int[m] : An array representing the total number entering from each gate \n \n\n \n Constraints \n \n 1 ≤ n, m ≤ 100000 \n 1 ≤ friends[i] ≤ 1000 \n 1 ≤ gates[i] ≤ m \n \n \n\n \n Input Format for Custom Testing \n The first