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.
Each digit position can be handled alone: count the digits in that column and count the pairs whose digits differ there.