Update recursive_digit_sum.py

This commit is contained in:
mankala sharathchandra 2024-10-19 15:32:01 +05:30 committed by GitHub
parent fc8f143dd1
commit d412a6e612
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -17,7 +17,8 @@ from __future__ import annotations
def super_digit(n_str: str, repetitions: int) -> int:
"""
Computes the super digit of a number formed by concatenating n_str repetitions times.
Computes the super digit of a number formed by concatenating
n_str repetitions times.
Parameters:
n_str (str): The string representation of the integer.
@ -34,6 +35,7 @@ def super_digit(n_str: str, repetitions: int) -> int:
9
"""
# Calculate the initial sum of the digits in n_str
digit_sum = sum(int(digit) for digit in n_str)