Trains the technique from
LeetCode 43Multiply StringsThis is an original problem, written from a brief that listed the technique, the difficulty, the topics, the function shape and the input bounds — none of that problem's wording, examples, hints or editorials. The link is there so you can map your practice onto the standard set.
Same function shape, different story and different numbers.
A stock-take terminal reads tallies off punched paper reels. A reel is written as a run of digit characters, heaviest digit first, and a reel can hold far more digits than any number type on the terminal can carry.
You are handed the reels left_reel and right_reel. Punch and return the reel that records their product. The digits are all you get to work with: feeding either reel into a built-in numeric type, or handing the job to a big-number library, is not allowed.
A reel never starts with a padding zero, the one exception being the single-digit reel "0", which stands for an empty tally. Your answer must obey the same rule.
Example 1
Column by column, 47 punched 206 times over lands on 9682, and no padding zero is needed in front.
Example 2
70 punched 30 times over lands on 2100. The trailing zero of each reel carries through to the answer, and no padding zero is written in front of it.
Example 3
An empty tally on one reel empties the product, and the answer is punched as the single digit 0 rather than a run of zeros.
The editor is preloaded with this. It matches the parent problem's shape, so a solution that works here transfers to a judge unchanged.
def reel_product(left_reel: str, right_reel: str) -> str:public String reelProduct(String leftReel, String rightReel)See the step-by-step animation, the intuition, and clean code in every language — free, no credit card.