@CYFCYF I think I am missing the point here... But could someone please explain to me, how this solution avoids the overflow error?

Is it because, in this case, we are not multiplying when there are 2 large numbers, but instead summing up each time, half of the number?