Panda Guru LogoPanda
Guru

Amazon| OA | Amazon Game

Round 1

Questions: Given the power boosters provided to n players where the three power boosters of the ith player are defined by (power_a[i], power_b[i], power_c[i]), find the number of players who are capable of defeating all other players in a game by using their power boosters optimally.

Function Description

Complete the function findCapableWinners in the editor.

findCapableWinners has the following parameter:

Returns

Example 1:

Input:

power_a = [9, 4, 2], power_b = [5, 12, 10], power_c = [11, 3, 13]

Output:

2

Explanation:
Consider the number of players to be n = 3, and their first set of power boosters to be power_a = [9, 4, 12], their second set of power boosters to be power_b = [5, 12, 10] and their third set of power boosters to be power_c = [11, 3, 13]. Thus, Player 1 has power boosters [9, 5, 11], Player 2 has [4, 12, 3] and Player 3 has power boosters [12, 10, 13].

Thus, Player 1 and Player 3 can defeat all the players using their power boosters optimally. Thus, the answer is 2.


Candidate's Approach

No approach provided.

Interviewer's Feedback

No feedback provided.