-Code
class 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 < index) {
int idx = (c - 'a' + 1) % 26;
c = alpa.charAt(idx);
if (!skip.contains(String.valueOf(c))) n++;
}
answer.append(c);
}
return answer.toString();
}
}
'Beakjoon&프로그래머스 > Java' 카테고리의 다른 글
[프로그래머스/Java] 최댓값과 최솟값 (0) | 2025.02.27 |
---|---|
[프로그래머스/Java] 문자열 나누기 (0) | 2025.02.27 |
[프로그래머스/Java] [1차] 다트 게임 (0) | 2025.02.27 |
[프로그래머스/Java] [PCCE 기출문제] 9번 / 지폐 접기 (0) | 2025.02.27 |
[프로그래머스/Java] 옹알이 (2) (0) | 2025.02.27 |