HTMLify

Q1837_Sum_of_Digits_in_Base_K.py
Views: 135 | Author: djdj
class Solution(object):
    def sumBase(self, n, k):
        s=0
        while n > 0: 
            r = n%k
            s = s+r  
            n=n//k    
        return s

Comments