Beakjoon&프로그래머스/Java466 [프로그래머스/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. [프로그래머스/Java] 약수의 개수와 덧셈 -Codeimport java.util.*;class Solution { public int solution(int left, int right) { int answer = 0; for (int i = left; i measures = new ArrayList(); for (int i = 1; i 2025. 2. 24. [프로그래머스/Java] 수박수박수박수박수박수? -Codeimport java.util.stream.*;class Solution { public String solution(int n) { return IntStream.range(0, n) .mapToObj(i -> i % 2 == 0 ? "수" : "박") .collect(Collectors.joining()); }} 2025. 2. 24. [프로그래머스/Java] 가운데 글자 가져오기 -Codeclass Solution { public String solution(String s) { int len = s.length(); return s.substring(len / 2 - (len % 2 == 0 ? 1 : 0), len / 2 + 1); }} 2025. 2. 24. 이전 1 ··· 8 9 10 11 12 13 14 ··· 78 다음