[프로그래머스] Lv.2 요격시스템 (Java)
·
Coding-Test
https://school.programmers.co.kr/learn/courses/30/lessons/181188 프로그래머스SW개발자를 위한 평가, 교육의 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr Lv.2 요격시스템import java.util.*;class Solution { public int solution(int[][] targets) { int answer = 0; Arrays.sort(targets, (a1, a2) -> a1[1] - a2[1]); int before = 0; for (int i = 0; i 핵심 정리1그리디 방식으로 해결해야 하며, 겹치는 구간을 하나의 미사일..
[프로그래머스] 알고리즘 고득점 Kit - 정렬 - 가장 큰 수 (Java)
·
Coding-Test/Programmers
https://school.programmers.co.kr/learn/courses/30/lessons/42746 프로그래머스SW개발자를 위한 평가, 교육의 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr 알고리즘 고득점 Kit - 정렬 - 가장 큰 수import java.util.*;class Solution { public String solution(int[] numbers) { String answer = ""; String[] str = new String[numbers.length]; for(int i = 0; i (){ @Override publi..
[프로그래머스] 알고리즘 고득점 Kit - 정렬 - K번째수 (Java)
·
Coding-Test/Programmers
https://school.programmers.co.kr/learn/courses/30/lessons/42748 프로그래머스SW개발자를 위한 평가, 교육의 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr 알고리즘 고득점 Kit - 정렬 - K번째수import java.util.*;class Solution { public int[] solution(int[] array, int[][] commands) { int[] answer = new int[commands.length]; int a = 0; for (int i = 0; i 핵심정리1. Array.sort() 활용 - 배열을 오름차순으로 정렬..
[프로그래머스] Lv.0 주사위 게임 1 (Java)
·
Coding-Test/Programmers
https://school.programmers.co.kr/learn/courses/30/lessons/181839 프로그래머스SW개발자를 위한 평가, 교육의 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프programmers.co.kr Lv.0 주사위 게임 1import java.lang.Math;class Solution { public int solution(int a, int b) { int answer = 0; if(a % 2 != 0 && b % 2 != 0) { answer = (int)Math.pow(a, 2) + (int)Math.pow(b, 2); } else if((a % 2 == 0 && b % 2 !..