Hello David, I am not sure it really answers my question. I was asking
"Where does the 'quadratic in the total number of digits in the input' in
the analysis come from"? As I don't see what is quadratic there (quadratic
in N, yes, but not in the total number of digits). The fact that your
As far as I can see my solution is simply O(N). With each number I store 2
integers, its value up to 10^11 and the number of additional 0s after that.
This can be done because any large number B' in the sequence ends in a
series of 0s. See the solution for details.
On Wednesday, April 14, 2021