leetle

Daily challenge for 2025-11-29

333. Sum of Digits in Base K

Given an integer n (in base 10) and a base k, return the sum of the digits of n after converting n from base 10 to base k.

Example:
Input: n = 34, k = 6
Output: 9

Explanation: 34 (base 10) expressed in base 6 is 54. 5 + 4 = 9.

Run this challenge interactively in Python or JavaScript when the app loads.