Python, almost brute force
There are 2 steps:\nStep1: Calculate the number of trailing zeros\nStep2: Multiply & Keep track of the first 12 numbers and the last 5 numbers\n\nFor step1, we 
There are 2 steps:\nStep1: Calculate the number of trailing zeros\nStep2: Multiply & Keep track of the first 12 numbers and the last 5 numbers\n\nFor step1, we need to know the number of factors 2 and 5 in [right, left], because 10 = 2 * 5. The minimum of the two will be the number of trailing zeros.\n\nFor step2, If the final number is less than 10 ** 10, I just output the number without abbreviation, but if the number exceeds 10 ** 10, then I switch to the calculation of the "big" number which needs abbreviation. For each, step, I only keep track of the first and last few numbers because they don\'t change by multiplication. \n\n```\nclass Solution:\n    def abbreviateProduct(self, left: int, right: int) -> str:\n        #Step1: count the num of trailing zeros\n        factor_two, factor_five = 0, 0\n        curr_factor = 2\n        while curr_factor <= right:\n            factor_two += (right // curr_factor) - ((left - 1) // curr_factor)\n            curr_factor *= 2\n        curr_factor = 5\n        while curr_factor <= right:\n            factor_five += (right // curr_factor) - ((left - 1) // curr_factor)\n            curr_factor *= 5\n        trailing_zeros = min(factor_two, factor_five)\n        \n        #Step2: Multiply until it gets too big, while dividing 2 and 5\n\t\tdivide_two_so_far, divide_five_so_far = 0, 0\n        curr_num = 1\n        for i in range(left, right + 1):\n            multiply = i\n            while multiply % 2 == 0 and divide_two_so_far < trailing_zeros:\n                multiply //= 2\n                divide_two_so_far += 1\n            while multiply % 5 == 0 and divide_five_so_far < trailing_zeros:\n                multiply //= 5\n                divide_five_so_far += 1\n            curr_num *= multiply\n            if curr_num >= 10 ** 10:\n                break\n        \n        #if the number doesn\'t get too large (less than or equal to 10 digits)\n        if curr_num < 10 ** 10:\n            return str(curr_num) + \'e\' + str(trailing_zeros)\n        \n        #Step2: if the number exceeds 10 ** 10, then keep track of the first and last digits\n        first_digits, last_digits = int(str(curr_num)[:12]), int(str(curr_num)[-5:])\n        start = i + 1\n        for i in range(start, right + 1):\n            multiply = i\n            while multiply % 2 == 0 and divide_two_so_far < trailing_zeros:\n                multiply //= 2\n                divide_two_so_far += 1\n            while multiply % 5 == 0 and divide_five_so_far < trailing_zeros:\n                multiply //= 5\n                divide_five_so_far += 1\n            first_digits = int(str(first_digits * multiply)[:12])\n            last_digits = int(str(last_digits * multiply)[-5:])\n        \n\t\t#output\n        return str(first_digits)[:5] + \'...\' + \'{:>05d}\'.format(last_digits) + \'e\' + str(trailing_zeros)\n```
['Python', 'Python3']