← All problemsSign in

2566. Maximum Difference by Remapping a Digit

LeetCodeMathGreedyOpen on judge ↗

You are given an integer num. You know that Bob will sneakily remap one of the 10 possible digits (0 to 9) to another digit. Return the difference between the maximum and minimum values Bob can make by remapping exactly one digit in num. Notes: - When Bob remaps a digit d1 to another digit d2, Bob replaces all occurrences of d1 in num with d2. - Bob can remap a digit to itself, in which case n

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start