Beakjoon&프로그래머스/Java466 [프로그래머스/Java] 다음에 올 숫자 -Codeclass Solution { public int solution(int[] common) { int len = common.length - 1; if (len == 1) return common[1] * 2 - common[0]; int[] gaps = new int[2]; for (int i = 1; i 2025. 2. 21. [프로그래머스/Java] OX퀴즈 -Codeclass Solution { public String[] solution(String[] quiz) { String[] answer = new String[quiz.length]; for (int i = 0; i 2025. 2. 21. [프로그래머스/Java] 저주의 숫자 3 -Codeimport java.util.*;class Solution { public int solution(int n) { int answer = 1; int now = 1; while (now 2025. 2. 21. [프로그래머스/Java] 치킨 쿠폰 -Codeclass Solution { public int solution(int chicken) { int answer = 0; while (chicken > 9) { int temp = chicken % 10; chicken /= 10; answer += chicken; chicken += temp; } return answer; }} 2025. 2. 20. [프로그래머스/Java] 로그인 성공? -Codeclass Solution { public String solution(String[] id_pw, String[][] db) { String answer = "fall"; for (String[] info : db) { if (info[0].equals(id_pw[0])) { if (info[1].equals(id_pw[1])) return "login"; answer = "wrong pw"; } } return answer; }} 2025. 2. 20. [프로그래머스/Java] 직사각형 넓이 구하기 -Codeclass Solution { public int solution(int[][] dots) { int x_min = 257, x_max = -257; int y_min = 257, y_max = -257; for (int[] dot : dots) { x_min = Math.min(dot[0], x_min); x_max = Math.max(dot[0], x_max); y_min = Math.min(dot[1], y_min); y_max = Math.max(dot[1], y_max); } return (x_max - x_min.. 2025. 2. 20. 이전 1 ··· 17 18 19 20 21 22 23 ··· 78 다음