문제 설명
해결과정
Solution.java
import java.util.*;
class Solution {
public String solution(int n, int t, int m, int p) {
String answer = "";
int num = 0;
String nNumber = "";
while(nNumber.length() <= t*m) {
nNumber += Integer.toString(num++, n);
}
// System.out.println(nNumber);
int cnt = 0;
nNumber = nNumber.toUpperCase();
for(int i = p-1; i < nNumber.length();) {
// System.out.print(nNumber.charAt(i));
answer += nNumber.charAt(i);
i += m;
cnt++;
if(cnt == t) {break;}
}
return answer;
}
}
Java
복사