Question 10

Write a function that receives string with decimal number (i.e. all characters are decimal digits) and prints the sum of all possible substring-numbers, example:

sum(“123”) = 123 + 12 + 23 + 1 + 2 + 3 = 167

New Report

Close