[Python3] Just Working Code - 27.09.2024
\npython3 []\nimport math\n\nclass Solution:\n    def abbreviateProduct(self, left: int, right: int) -> str:\n        last = 1\n        modulo = 10 ** 5\n\n    
\n```python3 []\nimport math\n\nclass Solution:\n    def abbreviateProduct(self, left: int, right: int) -> str:\n        last = 1\n        modulo = 10 ** 5\n\n        twosCount = 0\n        fivesCount = 0\n\n        sumLog10 = 0\n        maxBufferValue = 10 ** 1200\n        bufferProduct = 1\n        \n        for x in range(left, right + 1):\n            bufferProduct *= x\n\n            if bufferProduct > maxBufferValue:\n                sumLog10 += math.log10(bufferProduct)\n                bufferProduct = 1\n\n            while x % 2 == 0:\n                twosCount += 1\n                x //= 2\n                \n            while x % 5 == 0:\n                fivesCount += 1\n                x //= 5\n            \n            last = (last * x) % modulo        \n\n        sumLog10 += math.log10(bufferProduct)\n        zerosCount = min(twosCount, fivesCount)\n\n        if sumLog10 < 10 + zerosCount:\n            productString = str(bufferProduct)\n            return productString[:len(productString) - zerosCount] + \'e\' + str(zerosCount)\n        \n        twosCount -= zerosCount\n        fivesCount -= zerosCount        \n        \n        last = (last * pow(2, twosCount, modulo)) % modulo\n        last = (last * pow(5, fivesCount, modulo)) % modulo\n        first = int(pow(10, sumLog10 % 1 + 4.0))\n       \n        return str(first) + \'...\' + str(last).zfill(5) + \'e\' + str(zerosCount)\n```
['Python3']