Editorial for Chef and Tic-Tac-Toe

The problem is very simple for K=1.

## For **K=1** :

**K=1**

```
Simply check if there exists any cell on the board which has a '.' and if it exists then the answer is **YES** else **NO**.
```

## For **K>1** :

**K>1**

```
If we encounter a '.' then we need to check 4 things.
```

- Check number of consecutive ‘X’ in the corresponding row®.
- Check number of consecutive ‘X’ in the corresponding column©.
- Check number of consecutive ‘X’ in the corresponding left diagnol(ld).
- Check number of consecutive ‘X’ in the corresponding right diagnol(rd).

If at any step the count of * (r>=K)* or

*or*

**(c>=K)***or*

**(ld>=K)***then break and the answer is*

**(rd>=K)***.*

**YES**ELSE if after all steps none of the

*then the answer is*

**counts>=K***.*

**NO**## Here is the code for the same.

False. This is not an editorial for Chef and Tic-Tac-Toe.

I have posted it as an answer.