Warehouse Seal Suffix
Context
A warehouse assigns a seal value to a shipment batch. Starting with 1, the seal value is multiplied by every whole number from 1 through the batch size. The warehouse only records the final two decimal digits, so the full product is never needed.
Problem
Write a function that returns the final two decimal digits of the warehouse seal value for a batch containing shipment_count shipments. The seal value is the product of all integers from 1 through shipment_count. For a batch of size zero, use the standard empty-product rule: its value is 1. Return the result as an integer from 0 through 99, preserving the numeric meaning of the two-digit suffix. Reduce the running product modulo 100 after every multiplication. Once the shipment count is large enough that the factorial is divisible by 100, the answer remains 0 for every larger count; handle that case without constructing a large factorial.
Examples
shipment_count = 01shipment_count = 520shipment_count = 100Constraints
0 <= shipment_count <= 1000000000- Types:
shipment_countis int; result is int
Function signature
def warehouse_seal_suffix(shipment_count: int) -> int
shipment_countint- The nonnegative number of shipments in the batch.
- returns int
- The factorial of shipment_count modulo 100, representing the batch seal's final two decimal digits.
Adapted from MBPP problem task_692 (CC BY 4.0). Rewritten, extended and verified by Iksha.