I am getting Array Index out of bound exception unnecessary. I tried to do the dry run in copy but everything seems good. And in logcat I am getting this exception around if or else if condition.

```
for (int[] winningPosition : winningPos) {
    if (gameState[winningPosition[0]] == 0 && gameState[winningPosition[1]] != 1) {
        num = winningPosition[3];
        priority=true;
    }
    else if (gameState[winningPosition[1]] != 1 &&   gameState[winningPosition[3]] == 0) {
        num = winningPosition[1];
        priority=true;
    }
}

```