| [ Web Proxy ] |
| Viewing: https://raw.githubusercontent.com/mJackie/leetcode/master/code/lc130.java | [Back] [Original] |
package code;
/*
* 130. Surrounded Regions
* X O X
* Medium
* Depth-first Search, Breadth-first Search
* O1OX1O
* Tips
*/
public class lc130 {
public static void main(String[] args) {
char[][] board = {{'X','X','X','X'},{'X','O','O','X'},{'X','X','O','X'},{'X','O','X','X'}};
solve(board);
System.out.println(board);
}
public static void solve(char[][] board) {
if(board.length==0) return;
int[] row = {0, board.length-1};
for (int i = 0; i
| Web Proxy Viewer | New URL | Original Page |