Showing:
Handle Score
@Ibrahim Nash 5761
@akhayrutdinov 5111
@mb1973 4989
@Quandray 4944
@saiujwal13083 4506
@sanjay05 3762
@marius_valentin_dragoi 3516
@sushant_a 3459
@verma_ji 3341
@KshamaGupta 3318
Cricket Average
Basic Accuracy: 0.0% Submissions: 0 Points: 1

It’s time to find out which player is consistent in cricket. You need to calculate the average of a player based on his score. Player average is defined as total runs scored by a player in N matches divided by the number of matches in which he gets out.

Example 1:

Input: run = {10, 101, 49},
status = {"out", "notout", "out"}
Output: 80
Explanation: Total run = 10 + 101 + 49 = 160.
2 times the player gets out.
So, Average = 160 / 2 = 80.


Example 2:

Input: run = {6, 67, 5}, status = {"notout",
"notout", "notout"}.
Output: -1
Explanation: Not possible to determine average.


You don't need to read or print anything. Your task is to complete the function Average() which takes a list of runs and a list of status of the player in every match and retruns ceil value of the average. If not possible returns -1.

Expected Time Complexity: O(n) where n is the number of matches
Expected Space Complexity: O(1)

Constraints:
1 <= No. of matches <= 500
1 <= run scored in every match <= 300