Tap here to switch tabs
Problem
Submissions

Problem: Sum of Digits in Base K

med
30 min
Try to solve the Sum of Digits in Base K problem.

Statement

Given an integer n in base 1010 and an integer k, return the sum of the digits of n after converting n into base k.

Constraints:

  • 1≤n≤1001 \le n \le 100

  • 2≤k≤102 \le k \le 10

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Sum of Digits in Base K

med
30 min
Try to solve the Sum of Digits in Base K problem.

Statement

Given an integer n in base 1010 and an integer k, return the sum of the digits of n after converting n into base k.

Constraints:

  • 1≤n≤1001 \le n \le 100

  • 2≤k≤102 \le k \le 10