File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# [ level 1] 시저 암호 - 12926
22
3- [ 문제 링크] ( https://school.programmers.co.kr/learn/courses/30/lessons/12926?language=java )
3+ [ 문제 링크] ( https://school.programmers.co.kr/learn/courses/30/lessons/12926 )
44
55### 성능 요약
66
7- 메모리: 76.4 MB, 시간: 0.66 ms
7+ 메모리: 75.3 MB, 시간: 0.66 ms
88
99### 구분
1010
1616
1717### 제출 일자
1818
19- 2026년 06월 23일 08:54:20
19+ 2026년 06월 24일 09:49:04
2020
2121### 문제 설명
2222
Original file line number Diff line number Diff line change 11class Solution {
22 public String solution (String s , int n ) {
33 StringBuilder sb = new StringBuilder ();
4- for (int i = 0 ; i < s .length (); i ++) {
4+ for (int i = 0 ; i < s .length (); i ++) {
55 char c = s .charAt (i );
6-
76 if (c == ' ' ) sb .append (' ' );
8- else if (Character .isUpperCase (c )) sb .append ((char ) ('A' + (c - 'A' + n ) % 26 ));
9- else sb .append ((char ) ('a' + (c - 'a' + n ) % 26 ));
7+ else {
8+ if (Character .isUpperCase (c )) sb .append ((char ) ('A' + (c - 'A' + n ) % 26 ));
9+ else sb .append ((char ) ('a' + (c - 'a' + n ) % 26 ));
10+ }
1011 }
1112 return sb .toString ();
1213 }
You can’t perform that action at this time.
0 commit comments