Company: Rapido_10oct
Difficulty: medium
Collecting coins Problem Description Consider a battle-arena game featuring N heroes and M villains, with their strength levels given by arrays A and B respectively. A hero can defeat a villain whenever the hero's strength is at least as large as that villain's strength. Defeating a particular villain rewards the hero with a fixed number of coins, given by array C of size M. Determine the total number of coins each hero could collect by defeating any villains they are able to in the game. Notes: A hero's strength is not reduced after defeating a villain. The same villain can be defeated by more than one hero. Function Description: Complete the solve function. This function takes the following 5 parameters and returns an array of N integers representing the answer to the task described above: N: Represents the number of heroes in the game M: Represents the number of villains in the game A: Represents an array of N integers denoting the strength of the N heroes in the game B: Represents