블로그
- 110 옮기기 갯수를 세둔 후 마지막에 한번에 넣는식으로 처리해야함 stack 을 사용해서 char[] 으로 쪼개 하나씩 넣기 110 만나면 제거 가장 마지막 0 뒤에 110 갯수만큼넣기 */ class Solution { public String[] solution(String[] s) { String[] answer = new String[s.length]; for(int i
- 프로그래머스 보행자천국 6 10 1 4 10 1 5 1 왼쪽과 위의 경우의 수를 더하면 현재 위치의 도달 가능한 경우의 수 직진만 가능한 경우의 수 때문에 배열을 1개 더 해서 3중배열로 해야함 */ class Solution { int MOD = 20170805; public int solution(int m, int n, int[][] cityMap) { int[][][] cntArr
- (수정 중)PCCP모의고사2회 보물지도 .*; class Solution { class MyData{ int posX; int posY; int len; boolean used; int beforeMovePoint; public (int n, int m, int[][] hole) { int answer = Integer.MAX_VALUE; int[][] maps = new int[m][n]; for(int[
- 가장 먼 노드 .*; class Solution { class Node{ int node; List link = new LinkedList<>(); boolean visited = false ; int dist = 0; public Node(int n){ node = n; } } public int solution(int n, int[][] edge) { List li
- 순위 .*; class Solution { class Node { int node; int win_cnt = 0; int lose_cnt = 0; boolean visited = false (int n, int[][] results) { List node_li = new ArrayList<>(); for(int i=0;i
- 네트워크 .*; class Solution { public int solution(int n, int[][] computers) { int answer = 0; boolean[] visited = new boolean[n]; for(int i = 0;i q = new LinkedList<>(); if(!
- 단어변환 .*; class Solution { public int solution(String begin, String target, String[] words) { Queue q = new (txt.equals(target)){ return cnt; } // System.out.println(" txt == " + txt + " // step == " + cnt); for
- 정수삼각형 .*; class Solution { public int solution(int[][] triangle) { int answer = 0; for(int i = 1;i 0){ left
- 예산(풀이중) .*; class Solution { public int solution(int[] budgets, int M) { int avg = M/budgets.length; int mod = M%budgets.length; int n2 = 0; int cnt_over = 0; double sum = 0; int max = 0; for(int n : budgets){
- 행렬테두리 회전하기 .*; class Solution { public int[] solution(int rows, int columns, int[][] queries) { int[] answer = new int[queries.length]; int[][] sq = new int[rows][columns]; for(int i = 0;i
1 페이지
다음 →