Implement a generalized Tic-Tac-Toe game. The board is M×N (not necessarily 3×3 or square). A player wins by placing K consecutive marks in a line — horizontally, vertically, or diagonally (either direction) — where K is a configurable parameter. Implement a class TicTacToe(m, n, k) with a move(row, col, player)…