Implement a function find_ball_position(b, arr) that determines the final position of a ball placed under one of three cups after a series of swaps. The function should track the ball's current position as it is moved according to the provided swap instructions.
Input Requirements
The function accepts two parameters:
b (integer): The initial position of the ball (1, 2, or 3).
arr (list of tuples): Each tuple contains two integers representing the positions of the cups being swapped. The length of arr can vary but will contain at least one swap.
Output Requirements
The function should return an integer representing the final position of the ball after all the swaps have been executed.
Example
python
# Example input:
initial_position = 1
swaps = [(1, 2), (2, 3), (1, 3)]
# Example output:
final_position = find_ball_position(initial_position, swaps) # Should return 2
Implementation File
The solution must be written in a file called /app/solution.py. Ensure that the function is correctly defined and adheres to the specified input/output requirements.