목록전체 글 (103)
걸음마부터 달리기
https://school.programmers.co.kr/learn/courses/30/lessons/87946 프로그래머스SW개발자를 위한 평가, 교육의 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr class Solution { static int max=Integer.MIN_VALUE; static int cnt; public int solution(int k, int[][] dungeons) { int answer = -1; cnt = dungeons.length; int[] arr = new int[cnt]; boolean[] visited = new boolean[cnt]; ..

https://school.programmers.co.kr/learn/courses/30/lessons/42839 프로그래머스SW개발자를 위한 평가, 교육의 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr import java.util.*;class Solution { public static Map map = new HashMap(); public static int[] visited; public int solution(String numbers) { int answer = 0; for(int i=1; i0){ visited[i]--; combination(..

https://school.programmers.co.kr/learn/courses/30/lessons/42840 프로그래머스SW개발자를 위한 평가, 교육의 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr import java.util.*;class Solution { public int[] solution(int[] answers) { int[] ans = new int[]{0,0,0}; int[] a = new int[]{1,2,3,4,5} ; //5개씩 반복 int[] b = new int[] {2,1,2,3,2,4,2,5}; //8개씩 반복 int[] c = new int[] {3,3,1,1..
https://school.programmers.co.kr/learn/courses/30/lessons/42746 프로그래머스SW개발자를 위한 평가, 교육의 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr import java.util.*;class Solution { public String solution(int[] numbers) { String answer = ""; String[] arr = Arrays.stream(numbers).mapToObj(i -> i+"").toArray(String[]::new); Arrays.sort(arr, new Comparator(){ //3 31 ..
import java.util.*;class Solution { //작업의 소요시간이 짧은 것, 작업의 요청 시각이 빠른 것, 작업의 번호가 작은 것 public int solution(int[][] jobs) { int answer = 0; //Job 클래스 만들고 작업 소요시간 , 작업 요청 시각, 작업 번호를 저장 //우선순위 큐 만들기. Comparator로 우선순위 PriorityQueue pq = new PriorityQueue(new Comparator(){ @Override public int compare(Job j1 , Job j2){ if(j1.spend==..

https://school.programmers.co.kr/learn/courses/30/lessons/42626 프로그래머스SW개발자를 위한 평가, 교육의 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.krimport java.util.*;class Solution { public int solution(int[] scoville, int K) { int answer = 0; PriorityQueue pq = new PriorityQueue(); for(int sco : scoville){ pq.offer(sco); } while(pq.size()>1 && pq.peek..

https://school.programmers.co.kr/learn/courses/30/lessons/42587 프로그래머스SW개발자를 위한 평가, 교육의 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.krhttps://velog.io/@chaeeun2030/Stream-boxed Stream)으로 전환해준다. 전용으로 실행 가능한 (예를 들어 int 자체로는 Collection에 못 담기 때문에 In" data-og-host="velog.io" data-og-source-url="https://velog.io/@chaeeun2030/Stream-boxed" data-og-url="https://velog.io/@chaeeun2030/Stream-boxed..
https://school.programmers.co.kr/learn/courses/30/lessons/12909/solution_groups?language=java 프로그래머스SW개발자를 위한 평가, 교육의 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr import java.util.*;class Solution { boolean solution(String s) { boolean answer = true; Stack stack = new Stack(); for(int i=0; i최대한 시간을 짧게 가볼려고 중간에 특정 부분에서 break문 넣고 하다 보니 코드가 길어지고 가독성이 떨어지는 측면이 있다. 이..