public class Solution {

public void solve(char[][] board) {

if (board.length < 3 || board[0].length < 3)

{

return;

}

boolean[][] flag= new boolean[board.length][board[0].length];

```
for(int i=1;i<board.length-1;i++)
{
for(int j=1; j<board[0].length-1;j++)
{
if(board[i][j]=='o'&&board[i][j+1]=='x'&&board[i][j-1]=='x'&&board[i-1][j]=='x'&&board[i+1][j]=='x')
{
flag[i][j]=true;
}
}
}
for(int i=1;i<board.length-1;i++)
{
for(int j=1; j<board[0].length-1;j++)
{
if(flag[i][j]) board[i][j]='x';
}
}
}
```

}

Input ["xxx", "xox",“xxx”], and output is ["xxx", "xox", "xxx"]. But when I have my own test and take input as the one I provided above, I have the right output.

Please let me know if I have any misunderstanding about this problem.