Given a 2D board containing 'X' and 'O', capture all regions surrounded by 'X'.
Sample Input:
[["X","X","X","X"],["X","O","O","X"],["X","X","O","X"],["X","O","X","X"]]
Sample Output:
[["X","X","X","X"],["X","X","X","X"],["X","X","X","X"],["X","O","X","X"]]
Hints
Hint 1
Mark 'O's connected to borders (they can't be captured)
Hint 2
Use DFS/BFS from border 'O's to mark safe regions
Hint 3
Flip unmarked 'O's to 'X's