Problem 3153 · Medium

Sum of Digit Differences of All Pairs

Each digit position can be handled alone: count the digits in that column and count the pairs whose digits differ there.

Open the interactive visualisation