[Community Puzzle] Scaleable TicTacToe - Puzzle discussion

Coding Games and Programming Challenges to Code Better

Send your feedback or ask for help here!

Created by @hhgit,validated by @DeanTheMachine,@Delicious31415 and @ManuelJ.
If you have any issues, feel free to ping them.

Disappointed to see that this puzzle does not cover cases like this:

5 3
O..O.
..O..
XXXXX
.....
....O

(Besides, this is my preferred format - avoid using spaces at EOL in I/O data.)