IndexOutOfBoundsException triggered | LeetCode Where will the ball fall - C#