From f5a622beca1daa55e91ed96b8096b18c3564d077 Mon Sep 17 00:00:00 2001 From: hyeonji0108 Date: Thu, 5 Nov 2026 22:45:07 +0900 Subject: [PATCH 1/6] 36. Valid Sudoku --- .../36. Valid Sudoku" | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 "leetcode3/\352\263\275\355\230\204\354\247\200/36. Valid Sudoku" diff --git "a/leetcode3/\352\263\275\355\230\204\354\247\200/36. Valid Sudoku" "b/leetcode3/\352\263\275\355\230\204\354\247\200/36. Valid Sudoku" new file mode 100644 index 00000000..b6afd52a --- /dev/null +++ "b/leetcode3/\352\263\275\355\230\204\354\247\200/36. Valid Sudoku" @@ -0,0 +1,36 @@ +import java.util.Set; +import java.util.HashSet; + +class Solution { + public boolean isValidSudoku(char[][] board) { + Set trace = new HashSet<>(); // 중복된 값 입력을 방지하기 위함 + + // 행렬 수 만들기 + for (int i = 0; i < 9; i++) { + for (int j = 0; j < 9; j++) { + // 행렬 만들기 + char num = board[i][j]; + + // 칸이 비워져 있을 경우, 숫자 채우기위해 계속 진행하기 + if (num == '.') { + continue; + } + + String row = "row" + i + num; + String col = "col" + j + num; + String box = "box" + (i / 3) + (j / 3) + num; + + // 빈 칸에 trace에 저장된 숫자가 있을 경우, 숫자 입력 X + if (trace.contains(row) || + trace.contains(col) || + trace.contains(box)) { + return false; + } + trace.add(row); + trace.add(col); + trace.add(box); + } + } + return true; + } +} From 836bce04639fcd5ba1a84d4adeb4a0a7f717a32b Mon Sep 17 00:00:00 2001 From: hyeonji0108 Date: Thu, 5 Nov 2026 22:50:29 +0900 Subject: [PATCH 2/6] 48. Rotate Image --- .../48. Rotate Image" | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 "leetcode3/\352\263\275\355\230\204\354\247\200/48. Rotate Image" diff --git "a/leetcode3/\352\263\275\355\230\204\354\247\200/48. Rotate Image" "b/leetcode3/\352\263\275\355\230\204\354\247\200/48. Rotate Image" new file mode 100644 index 00000000..67e833e1 --- /dev/null +++ "b/leetcode3/\352\263\275\355\230\204\354\247\200/48. Rotate Image" @@ -0,0 +1,14 @@ +class Solution { + public void rotate(int[][] matrix) { + int n = matrix.length; + + // 행렬 위치 바꾸기 + for (int = 0; i < n; i++) { + for (int j = 0; j < n; j++) { + int temp = matrix[i][j]; + matrix[i][j] = matrix[n-i][n-j] + matrix[n-i][n-j] = temp; + } + } + } +} From 667fdfb6adece875ca4f3b9456b002098ea95b95 Mon Sep 17 00:00:00 2001 From: hyeonji0108 Date: Thu, 5 Nov 2026 23:01:31 +0900 Subject: [PATCH 3/6] Create 1733. Minimum number of people to Teach --- .../1733. Minimum number of people to Teach" | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 "leetcode3/\352\263\275\355\230\204\354\247\200/1733. Minimum number of people to Teach" diff --git "a/leetcode3/\352\263\275\355\230\204\354\247\200/1733. Minimum number of people to Teach" "b/leetcode3/\352\263\275\355\230\204\354\247\200/1733. Minimum number of people to Teach" new file mode 100644 index 00000000..ba4618c9 --- /dev/null +++ "b/leetcode3/\352\263\275\355\230\204\354\247\200/1733. Minimum number of people to Teach" @@ -0,0 +1,16 @@ +class Solution { + public int minimumTeachings(int n, int[][] languages, int[][] friendships) { + int m = languages.length; + + boolean[][] knows = new boolean[m + 1][n + 1]; + + for (int i = 0; i < m; i++) { + for (int lang : languages[i]) { + knows[i + 1][lang] = true; + } + } + + // 대화할 수 없는 친구 찾기 + boolean[] needTeach = new boolean[m + 1]; + } +} From 4c4d91c79bf1767490ab1fe0afbd6e038e3b927f Mon Sep 17 00:00:00 2001 From: hyeonji0108 Date: Thu, 5 Nov 2026 23:03:50 +0900 Subject: [PATCH 4/6] =?UTF-8?q?Delete=20leetcode3/=EA=B3=BD=ED=98=84?= =?UTF-8?q?=EC=A7=80/36.=20Valid=20Sudoku?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../36. Valid Sudoku" | 36 ------------------- 1 file changed, 36 deletions(-) delete mode 100644 "leetcode3/\352\263\275\355\230\204\354\247\200/36. Valid Sudoku" diff --git "a/leetcode3/\352\263\275\355\230\204\354\247\200/36. Valid Sudoku" "b/leetcode3/\352\263\275\355\230\204\354\247\200/36. Valid Sudoku" deleted file mode 100644 index b6afd52a..00000000 --- "a/leetcode3/\352\263\275\355\230\204\354\247\200/36. Valid Sudoku" +++ /dev/null @@ -1,36 +0,0 @@ -import java.util.Set; -import java.util.HashSet; - -class Solution { - public boolean isValidSudoku(char[][] board) { - Set trace = new HashSet<>(); // 중복된 값 입력을 방지하기 위함 - - // 행렬 수 만들기 - for (int i = 0; i < 9; i++) { - for (int j = 0; j < 9; j++) { - // 행렬 만들기 - char num = board[i][j]; - - // 칸이 비워져 있을 경우, 숫자 채우기위해 계속 진행하기 - if (num == '.') { - continue; - } - - String row = "row" + i + num; - String col = "col" + j + num; - String box = "box" + (i / 3) + (j / 3) + num; - - // 빈 칸에 trace에 저장된 숫자가 있을 경우, 숫자 입력 X - if (trace.contains(row) || - trace.contains(col) || - trace.contains(box)) { - return false; - } - trace.add(row); - trace.add(col); - trace.add(box); - } - } - return true; - } -} From 8f463c6c3aa1856598798bfbb68c8e520df03db0 Mon Sep 17 00:00:00 2001 From: hyeonji0108 Date: Thu, 5 Nov 2026 23:04:01 +0900 Subject: [PATCH 5/6] =?UTF-8?q?Delete=20leetcode3/=EA=B3=BD=ED=98=84?= =?UTF-8?q?=EC=A7=80/48.=20Rotate=20Image?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../48. Rotate Image" | 14 -------------- 1 file changed, 14 deletions(-) delete mode 100644 "leetcode3/\352\263\275\355\230\204\354\247\200/48. Rotate Image" diff --git "a/leetcode3/\352\263\275\355\230\204\354\247\200/48. Rotate Image" "b/leetcode3/\352\263\275\355\230\204\354\247\200/48. Rotate Image" deleted file mode 100644 index 67e833e1..00000000 --- "a/leetcode3/\352\263\275\355\230\204\354\247\200/48. Rotate Image" +++ /dev/null @@ -1,14 +0,0 @@ -class Solution { - public void rotate(int[][] matrix) { - int n = matrix.length; - - // 행렬 위치 바꾸기 - for (int = 0; i < n; i++) { - for (int j = 0; j < n; j++) { - int temp = matrix[i][j]; - matrix[i][j] = matrix[n-i][n-j] - matrix[n-i][n-j] = temp; - } - } - } -} From 348f09f5a4eae42dd22eef45c9191e48cc9dc684 Mon Sep 17 00:00:00 2001 From: hyeonji0108 Date: Thu, 5 Nov 2026 23:10:04 +0900 Subject: [PATCH 6/6] 3857. Minimum Cost to Split into Ones --- .../3857. Minimum Cost to Split into Ones" | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 "leetcode3/\352\263\275\355\230\204\354\247\200/3857. Minimum Cost to Split into Ones" diff --git "a/leetcode3/\352\263\275\355\230\204\354\247\200/3857. Minimum Cost to Split into Ones" "b/leetcode3/\352\263\275\355\230\204\354\247\200/3857. Minimum Cost to Split into Ones" new file mode 100644 index 00000000..afdcdce1 --- /dev/null +++ "b/leetcode3/\352\263\275\355\230\204\354\247\200/3857. Minimum Cost to Split into Ones" @@ -0,0 +1,7 @@ +class Solution { + public int minCost(int n) { + int ranivelotu = n; + + return ranivelotu * (ranivelotu - 1) / 2; + } +}