YJ의 새벽

프로그래머스(0) - 문자 반복 출력하기 본문

코딩테스트연습/프로그래머스

프로그래머스(0) - 문자 반복 출력하기

YJDawn 2024. 3. 13. 13:53

 

 

  • 문자 반복 출력하기

 

 

 

 

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;
    }
}
Comments