Throw The Ball
In a park, there are n friends standing in a random order, and they plan to throw a ball around. Each friend has a unique number in the range of 1 to n, inclusive. The i^th friend will always throw the ball towards the friend given at receiver[i], and this will happen each second. Friend 1 always starts with the ball, and a player always throws to another player. Determine which friend has the ball after k seconds pass.
Note: Friends are numbered starting with 1.
Complete the function throwTheBall in the editor.
throwTheBall has the following parameters:
int receiver[n]: thei^th friend will throw the ball to the friend indicated inreceiver[i]int seconds: the time in seconds that the game lasts
Returns
int: the friend holding the ball at time = seconds
1Example 1

Constraints
Limits and guarantees your solution can rely on.
2 ≤ n ≤ 10^51 ≤ receiver[i] ≤ n (receiver[i] ≠ i)1 ≤ seconds ≤ 10^12