본문 바로가기

Programmers/Level1

(66)
나머지가 1이 되는 수 찾기 12345678910111213class Solution { public int solution(int n) { int answer = 0; for(int i=2;i
최소직사각형 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 import java.util.*; class Solution { public int solution(int[][] sizes) { int answer = 0; HashSet set = new HashSet(); ArrayList list = new ArrayList(); for(int i=0;i l){ flag = false; break; } } if(flag){ answer = l * a; break; } } return answer; } } Colored by Color Scripter cs 가장 큰 값을 제외한, 나머지 변의 최소 값을 구하였다.
복서 정렬하기 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 import java.util.*; class Solution { public int[] solution(int[] weights, String[] head2head) { int n = weights.length; int[] answer = new int[n]; ArrayList list = new ArrayList(); // 선수 정보 계산 for(..
없는 숫자 더하기 1 2 3 4 5 6 7 8 class Solution { public int solution(int[] numbers) { int answer = 45; for(int i=0;i
상호 평가 12345678910111213141516171819202122232425262728293031323334353637383940414243class Solution { public String solution(int[][] scores) { String answer = ""; for(int i=0;i= 80) answer += "B"; else if(sum >= 70) answer += "C"; else if(sum >= 50) answer += "D"; else answer += "F"; } return answer; }}Colored by Color Scriptercs
부족한 금액 계산하기 123456789101112class Solution { public long solution(long price, long money, int count) { long answer = 0; for(int i=1;i
상위 n개 레코드 1SELECT NAME FROM ANIMAL_INS ORDER BY DATETIME LIMIT 1cs
여러 기준으로 정렬하기 1SELECT ANIMAL_ID, NAME, DATETIME FROM ANIMAL_INS ORDER BY NAME, DATETIME DESCcs