Hacker rank doubt

Can u help me solving this sum??

realize that the sum of digits of "big number of digits here" + ... + "big number of digits here" with the above concatenation/replication N times, and getting the sum of the huge, gigantic number, is equal to the sum of the digits "big number of digits here" times N .

i.e. with  `n=12345`  and  `k=5` :

“12345” replicated 5 times = “1234512345123451234512345”, if you get one of the test cases with a string 1,000 characters long, replicated 10,000 times, you end up with a number of 100,000 digits. Non-sense. sumOfDigits(“1234512345123451234512345”) = 75 # is exactly the same as 5

sumOfDigits("12345") = 15 5 * 15 = 75 # From here on, all digit-sums are quick and ease

Understand the logic from here, rest you can code for this problem if you are familiar with recursion

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.