2
def abbreviateProduct(self, left: int, right: int) -> str:6
for i in range(left, right + 1):7
# count and remove all 2 and 515
# track top 12 and last 516
top12 = int(str(top12 * i)[:12])17
tail5 = tail5 * i % 10000019
# multiply the remained 2 or 521
for _ in range(c2 - c5):22
top12 = int(str(top12 * 2)[:12])23
tail5 = tail5 * 2 % 10000025
for _ in range(c5 - c2):26
top12 = int(str(top12 * 5)[:12])27
tail5 = tail5 * 5 % 10000031
# as is included in top 12, it's easy to tell when d<=1032
if len(str(top12)) <= 10:33
return str(top12) + "e" + str(zero)38
+ "0" * (5 - len(str(tail5)))