YJ의 새벽
프로그래머스(0) - 문자 반복 출력하기 본문
- 문자 반복 출력하기
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;
}
}
'코딩테스트연습 > 프로그래머스' 카테고리의 다른 글
프로그래머스(0) - 모음 제거 (0) | 2024.03.13 |
---|---|
프로그래머스(0) - 순서쌍의 개수 (0) | 2024.03.13 |
프로그래머스(0) - 최댓값 만들기(1) (0) | 2024.03.13 |
프로그래머스(0) - 삼각형의 완성조건(1) (0) | 2024.03.13 |
프로그래머스(0) - 문자열 안에 문자열 (0) | 2024.03.13 |
Comments