implemented with n x n board and check for horizontal rows