반응형
문자 반복 출력하기 (JAVA)
class Solution {
public String solution(String my_string, int n) {
String answer = "";
for(int i = 0; i<my_string.length(); i++){
for(int j = 0; j<n; j++){
answer += my_string.charAt(i);
}
}
return answer;
}
}
반응형
'알고리즘 > 프로그래머스:LV00' 카테고리의 다른 글
[LV00] 각도기 (0) | 2023.04.18 |
---|---|
[LV00] 특정 문자 제거하기 (0) | 2023.04.17 |
[LV00] 짝수는 싫어요 (0) | 2023.01.18 |
[LV00] 최빈값 구하기 (0) | 2023.01.18 |
[LV00] 중앙값 구하기 (0) | 2023.01.09 |