number. A repaint picks a digit x and a digit y (possibly equal to x) and replaces **every** occurrence of x in the decimal form of the number with y. The result must not start with a zero and must not be zero.
Two repaints are applied to the original number independently of each other: the first produces a, the second produces b.
Return the largest possible value of a - b.number=2702 → 8008
Largest: turn every 2 into 9 to get 9709. Smallest: turn every 2 into 1 to get 1701. The spread is 9709 − 1701 = 8008.
number=1090 → 8090
Largest: 1 → 9 gives 9090. The leading 1 cannot go lower (no leading zero allowed), so turn 9 into 0 to get 1000. The spread is 8090.
number=7 → 8
number=2702
8008
Run checks the first 3 tests in your browser. Submit checks all 75 tests on the server, hidden ones included.