File tree Expand file tree Collapse file tree
프로그래머스/1/12930. 이상한 문자 만들기 Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# [ level 1] 이상한 문자 만들기 - 12930
22
3- [ 문제 링크] ( https://school.programmers.co.kr/learn/courses/30/lessons/12930 )
3+ [ 문제 링크] ( https://school.programmers.co.kr/learn/courses/30/lessons/12930?language=java )
44
55### 성능 요약
66
7- 메모리: 10.1 MB, 시간: 0.05 ms
7+ 메모리: 75.7 MB, 시간: 0.04 ms
88
99### 구분
1010
1616
1717### 제출 일자
1818
19- 2024년 07월 05일 03:51:00
19+ 2026년 06월 22일 21:06:56
2020
2121### 문제 설명
2222
Original file line number Diff line number Diff line change 1+ class Solution {
2+ public String solution (String s ) {
3+ StringBuilder sb = new StringBuilder ();
4+ int idx = 0 ;
5+
6+ for (char c : s .toCharArray ()) {
7+ if (c == ' ' ) {
8+ sb .append (c );
9+ idx = 0 ;
10+ } else {
11+ if (idx % 2 == 0 ) {
12+ sb .append (Character .toUpperCase (c ));
13+ } else {
14+ sb .append (Character .toLowerCase (c ));
15+ }
16+ idx ++;
17+ }
18+ }
19+ return sb .toString ();
20+ }
21+ }
You can’t perform that action at this time.
0 commit comments