class Solution {
public String solution(String my_string, int k) {
StringBuilder sb = new StringBuilder();
for (int i=0;i<k;i++){
sb.append(my_string);
}
return sb.toString();
}
}
[다른 사람 풀이]
class Solution {
public String solution(String my_string, int k) {
return my_string.repeat(k);
}
}
my_string.repeat(k) 하면 k번만큼 my_string 반복... 천재적이다