Beakjoon&프로그래머스/Java457 [프로그래머스/Java] 직사각형 별찍기 -Codeimport java.util.Scanner;class Solution { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a = sc.nextInt(); int b = sc.nextInt(); for (int i = 0; i 2025. 2. 25. [프로그래머스/Java] K번째수 -Codeimport java.util.*;class Solution { public int[] solution(int[] array, int[][] commands) { List answer = new ArrayList(); for (int[] command : commands) { int[] arr = Arrays.stream(Arrays.copyOfRange(array, command[0] - 1, command[1])) .sorted().toArray(); answer.add(arr[command[2] - 1]); } return answer.stream(.. 2025. 2. 25. [프로그래머스/Java] 행렬의 덧셈 -Codeclass Solution { public int[][] solution(int[][] arr1, int[][] arr2) { int row = arr1.length, col = arr1[0].length; int[][] answer = new int[row][col]; for (int i = 0; i 2025. 2. 24. [프로그래머스/Java] 문자열 다루기 기본 -Codeclass Solution { public boolean solution(String s) { if (s.length() != 4 && s.length() != 6) return false; for (char c : s.toCharArray()) { if (!Character.isDigit(c)) return false; } return true; }} 2025. 2. 24. [프로그래머스/Java] 부족한 금액 계산하기 -Codeclass Solution { public long solution(int price, int money, int count) { long total = 0; for (int i = 1; i 2025. 2. 24. [프로그래머스/Java] 문자열 내림차순으로 배치하기 -Codeimport java.util.*;class Solution { public String solution(String s) { String[] s_arr = Arrays.stream(s.split("")) .sorted(Collections.reverseOrder()) .toArray(String[]::new); return String.join("", s_arr); }} 2025. 2. 24. 이전 1 ··· 6 7 8 9 10 11 12 ··· 77 다음