로딩
요청 처리 중입니다...

JAVA_LeetCode 130_Surrounded Regions

 JAVA_LeetCode 130_Surrounded Regions

JAVA_LeetCode 130_Surrounded Regions 풀이 class Solution { public void solve(char[][] board) { if(board == null || board.length == 0) return; int row = board.length, col = board[0].length; Queue queue = new LinkedList(); // 테두리에서 'O' 발견 시 'T' 단어로 치환(감싸고 있는 부분 제외) for(int i = 0; i < row; i++) { if(board[i][0] == 'O'){ queue.offer(new int[]{i, 0}); board[i][0] = 'T'; } if(board[i][col - 1] == 'O'){ queue.offer(new int[]{i, col - 1}); board[i][col - 1] = 'T';} } for(int j = 0; j < col; j++){...