diff --git "a/leetcode2/1easy/\354\265\234\354\233\220\354\244\200/Q3402.java" "b/leetcode2/1easy/\354\265\234\354\233\220\354\244\200/Q3402.java" new file mode 100644 index 00000000..4953a059 --- /dev/null +++ "b/leetcode2/1easy/\354\265\234\354\233\220\354\244\200/Q3402.java" @@ -0,0 +1,29 @@ +package Leetcode.최원준; + +/* +1. 아이디어 : +전 행의 값보다 1 큰 값으로 채워 넣습니다. + +2. 시간복잡도 : +O( n * m ) + +3. 자료구조/알고리즘 : +- / 브루트 포스 + */ + +public class Q3402 { + class Solution { + public int minimumOperations(int[][] grid) { + int n = grid.length, m = grid[0].length; + int ans = 0; + for (int row = 1; row counts = new ArrayList<>(); + Map counter = new HashMap<>(); + int[] nums, quantity; + int n, m; + boolean ans = false; + + public void backtrack(int idx) { + if (ans) return; + if (idx == m) { + ans = true; + return; + } + + int q = quantity[idx]; + for (int i=0; i