E - Sum of All Substrings Editorial by assert_0

Editorial

Find that answer equals \( \sum_{i=1}^{i=n} 10^{(n-i) } A_i \),which means to add \(A_i\) on position \(0\) to position \(n-i\).

This could be done by prefix sum.

posted:
last update: