프로그래머스 [3차] n진수 게임 - java


프로그래머스 [3차] n진수 게임 - java

문제를 따라가면서 구현하면 된다. class Solution { public String solution(int n, int t, int m, int p) { String result = ""; int number = 0; int cursor = 0; while (result.length() < t) { String nBasedNumber = Integer.toString(number, n).toUpperCase(); for (int i = 0 ; i < nBasedNumber.length() ; i++) { if (cursor%m == p-1) { result = result + nBasedNumber.charAt(i); if (result.length() == t) { break; } } cursor++; } number++; } //System.out.println(Integer.toString(121518, 16).toUpperCase()); return result; } }...



원문링크 : 프로그래머스 [3차] n진수 게임 - java