Recursive Digit Sum

  • + 0 comments
    def superDigit(n, k):
        return (sum(map(int, list(n))) * k) % 9 or 9