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

JAVA_LeetCode 73_Set Matrix Zeroes

 JAVA_LeetCode 73_Set Matrix Zeroes

JAVA_LeetCode 73_Set Matrix Zeroes 풀이 class Solution { public void setZeroes(int[][] matrix) { int row = matrix[0].length, col = matrix.length; boolean rowBool = false, colBool = false; // 첫번째 행 체크 for(int i = 0; i < row; i++){ if(matrix[0][i] == 0) rowBool = true; } // 첫번째 열 체크 for(int i = 0; i < col; i++){ if(matrix[i][0] == 0) colBool = true; } // 0인경우 첫번째 행, 열 값을 0으로 초기화 for(int i = 1; i < col; i++){ for(int j = 1; j < row; j++){ if(matrix[i][j] == 0){ matrix[i][0] = 0; matrix[0][j] = 0; } }...