From c6c07e6f61a56494c77a7992fcca4b13a9a5161a Mon Sep 17 00:00:00 2001 From: lkhyun <102892446+lkhyun@users.noreply.github.com> Date: Sat, 25 Oct 2025 21:35:41 +0900 Subject: [PATCH] =?UTF-8?q?[20251025]=20PGM=20/=20Lv2=20/=20n=EC=A7=84?= =?UTF-8?q?=EC=88=98=20=EA=B2=8C=EC=9E=84=20/=20=EC=9D=B4=EA=B0=95?= =?UTF-8?q?=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Implement solution for nė§„ėˆ˜ ę˛Œėž„ with conversion function. --- ...4\354\210\230 \352\262\214\354\236\204.md" | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 "lkhyun/202510/25 PGM Lv2 n\354\247\204\354\210\230 \352\262\214\354\236\204.md" diff --git "a/lkhyun/202510/25 PGM Lv2 n\354\247\204\354\210\230 \352\262\214\354\236\204.md" "b/lkhyun/202510/25 PGM Lv2 n\354\247\204\354\210\230 \352\262\214\354\236\204.md" new file mode 100644 index 00000000..24a99010 --- /dev/null +++ "b/lkhyun/202510/25 PGM Lv2 n\354\247\204\354\210\230 \352\262\214\354\236\204.md" @@ -0,0 +1,26 @@ +```python +def solution(n, t, m, p): + answer = '' + total = '' + cur = 0 + while len(total) <= t*m: + total += convert(cur,n) + cur+=1 + + for i in range(t): + answer += total[i*m + p - 1] + return answer + +def convert(num, base): + + if num == 0: + return '0' + + digit = "0123456789ABCDEF" + result = '' + while num > 0: + result = digit[num%base] + result + num //= base + + return result +```