Computing a square-root is unnecessary; further, it only works when `kBoardSize` is a perfect square. Prefer

```
const int kBoardLength = 3;
const int kBoardSize = kBoardLength * kBoardLength;
```

A more overarching tension is this code is: should the board size really be a constant? The code is written so abstractly as to support any board size. But then the board size is fixed to a constant. I would choose one of the following directions to proceed in:

1. Commit to a board size of 9. In this case, I would recommend hard-coding the win conditions in `winDetection`. There are only 8 ways to win, so the resulting code would be a lot cleaner.

2. Allow arbitrary board sizes. In this case, you should accept a `boardLength` argument. Further, you will have to refine the notion of an `UnreachableState`. For example, in 4-by-4 tic tac toe, the following state is unreachable, but not detected by your code:
```
x x x x
o o o o
x x x x
o o o o
```