Recent Posts
Recent Comments
목록레벨1 (1)
밍쎄의 코딩공간

1. 문자열의 모든 문자에 대해 반복 A. 문자가 공백 문자일 경우 - 그대로 이어 붙이기 - 다음 등장하는 알파벳은 대문자 B. 공백 문자가 아닌 경우 - 대, 소문자 변환하여 이어 붙이기 - 다음 등장하는 알파벳의 대, 소문자는 현재 변환하는 문자와 반대 class Solution { public String solution(String s) { StringBuilder builder = new StringBuilder(); boolean toUpper = true; for (char c : s.toCharArray()){ if(!Character.isAlphabetic(c)){ builder.append(c); toUpper = true; }else{ if(toUpper){ builder.appen..
프로그래머스/프로그래머스 LV.1
2023. 8. 24. 00:48