C math solution
See problem hints for why this works.\n\n#define MAX_CONTIGUOUS 10000000000ULL\n\nchar *abbreviateProduct(int left, int right){\n    // Max size: #####...#####e
See problem hints for why this works.\n```\n#define MAX_CONTIGUOUS 10000000000ULL\n\nchar *abbreviateProduct(int left, int right){\n    // Max size: #####...#####e####\n    char* ret = calloc(19, sizeof(char));\n    \n    uint64_t product = 0;\n    uint32_t top = 0;\n    uint32_t bottom = 0;\n    // 10000! has 2499 trailing zeros\n    uint16_t numZeros = 0;\n    \n    { // Num zeros\n        uint16_t numTwos = 0;\n        uint16_t numFives = 0;\n\n        for (uint16_t m = left; m <= right; m++) {\n            uint16_t cur = m;\n            \n            for(; (cur % 2) == 0; cur /= 2, numTwos++);\n            for(; (cur % 5) == 0; cur /= 5, numFives++);\n        }\n        \n        numZeros = (numTwos < numFives) ? numTwos : numFives;\n    }\n    \n    { // Bottom 5 digits\n        uint16_t numTwos = numZeros;\n        uint16_t numFives = numZeros;\n\n        bottom = 1;\n        product = 1;\n        for (uint16_t m = left; m <= right; m++) {\n            uint16_t cur = m;\n            \n            for(; (cur % 2) == 0 && numTwos  > 0; cur /= 2, numTwos--);\n            for(; (cur % 5) == 0 && numFives > 0; cur /= 5, numFives--);\n            \n            bottom *= cur;\n            bottom %= 100000;\n            \n            if (product < MAX_CONTIGUOUS) {\n                product *= cur;\n            }\n        }\n    }\n    \n    // Top 5 digits\n    if (product >= MAX_CONTIGUOUS) { \n        // \'long double\' precision is required for all tests to pass.\n        long double sum = 0;\n        double temp = 0;\n        \n        for (double m = left; m <= right; m++) {\n            sum += log10(m);\n        }\n        \n\t\t// Set sum to fraction part of the double\n        sum = modf(sum, &temp);\n        top = floor(pow(10.0, 4.0 + sum));\n    }\n    \n    if (product < MAX_CONTIGUOUS) {\n        sprintf(ret, "%llue%lu", product, numZeros);\n    } else {\n        sprintf(ret, "%lu...%05lue%lu", top, bottom, numZeros);\n    }\n    \n    return ret;\n}\n```
['Math', 'C']