Company: Rapido_10oct
Difficulty: medium
Collecting coins Problem Description John is playing a battle royale game in which the game consists of N heroes and M villains. The powers of the heroes and the villains are represented by arrays A and B, respectively. A hero can defeat a villain if his power is greater than or equal to the villain's power. A hero gains some number of coins corresponding to the villain he defeated. After defeating a particular villain, the coins are represented by an array C of size M. Find out the number of coins each hero can collect by defeating any villains in the game. Notes: The health of a hero doesn't get reduced after defeating a villain. A villain can be defeated by multiple heroes. Function Description: Complete the solve function. This function takes the following 5 parameters and returns an array of N integers that represents the answer to the task as described above in the problem statement: N: Represents the number of heroes in the game M: Represents the number of villains in the game A