Trains the technique from
LeetCode 3536Maximum Product of Two DigitsThis 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 mechanical counter shows the value reading on a row of digit wheels, one wheel per decimal digit, with no leading wheel showing a zero.
An inspector picks two different wheels and multiplies the two digits they show. Two wheels showing the same digit are still two different wheels, so a repeated digit may be used twice as long as it comes from two separate wheels.
Return the largest product the inspector can obtain.
Example 1
The wheels show 7, 7, 4 and 4. The two wheels showing 7 are different wheels, so their digits multiply to 49.
Example 2
The wheels show 4, 5, 0, 6 and 7, and the wheels showing 7 and 6 multiply to 42.
Example 3
The wheels show 8, 0, 6 and 9, and the wheels showing 9 and 8 multiply to 72.
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 largest_dial_product(reading: int) -> int:public int largestDialProduct(int reading)See the step-by-step animation, the intuition, and clean code in every language — free, no credit card.