Skip to content

Practice Abbreviating the Product of a Range

Read the task, work through the examples, and check your approach against the constraints. Use the original LeetCode task for coding and submissions.

Hard#2117
LeetCode Problem

Abbreviating the Product of a Range

Problem Statement

Multiply all integers from left through right inclusive. Remove every trailing zero and record their count C. If the remaining number has at most ten digits, keep it in full; otherwise keep its first five digits, then ..., then its last five digits. Preserve zeros within that five-digit suffix. Append e followed by C and return the string.

Source: Abbreviating the Product of a Range on LeetCode. Use the original task for its coding environment and submissions.

Examples

# Example 1

Input
left = 1, right = 4
Output
"24e0"

# Example 2

Input
left = 2, right = 11
Output
"399168e2"

# Example 3

Input
left = 371, right = 375
Output
"7219856259e3"

Constraints

1 <= left <= right <= 10^4

Related LeetCode Problems

Practice more problems similar to Abbreviating the Product of a Range.

Review your practice with PhantomCodeAI

After trying the problem yourself, use the app to discuss your approach, complexity, and edge cases.