본문 바로가기

Beakjoon&프로그래머스/Java457

[프로그래머스/Java] JadenCase 문자열 만들기 -Codeclass Solution { public String solution(String s) { String[] s_arr = s.toLowerCase().split(" ", -1); for (int i = 0; i 2025. 2. 28.
[프로그래머스/Java] 최솟값 만들기 -Codeimport java.util.Arrays;class Solution{ public int solution(int []A, int []B){ int answer = 0; int len = A.length; Arrays.sort(A); Arrays.sort(B); for (int i = 0; i 2025. 2. 28.
[프로그래머스/Java] 최댓값과 최솟값 -Codeimport java.util.*;import java.util.stream.Collectors;class Solution { public String solution(String s) { List list = Arrays.stream(s.split(" ")) .mapToInt(Integer::parseInt) .boxed() .collect(Collectors.toList()); return Collections.min(list) + " " + Collections.max(list); }} 2025. 2. 27.
[프로그래머스/Java] 문자열 나누기 -Codeclass Solution { public int solution(String s) { int answer = 0; int same = 0, different = 0; String now = ""; for (String el : s.split("")) { if (now.isEmpty()) { now = el; } if (now.equals(el)) same++; else different++; if (same == different) { answer++; .. 2025. 2. 27.
[프로그래머스/Java] 둘만의 암호 -Codeclass Solution { public String solution(String s, String skip, int index) { StringBuilder answer = new StringBuilder(); String alpa = "abcdefghijklmnopqrstuvwxyz"; for (char c : s.toCharArray()) { int n = 0; while (n 2025. 2. 27.
[프로그래머스/Java] [1차] 다트 게임 -Codeimport java.util.List;class Solution { public int solution(String dartResult) { int answer = 0; int now = 0, temp = 0; int idx = 0, total = 0; boolean flag = true; while (idx 0) { now = (int) Math.pow(now, bonus); } if (c == '*') { now *= 2; flag = false; } else if (c == '#').. 2025. 2. 27.