Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
You can solve the problem for digits that are on the same position separately, and then sum up all the answers.
For each position, count the number of occurences of each digit from 0 to 9 that appear on that position.
Let <code>c</code> be the number of occurences of a digit on a position, that will contribute with <code>c * (n - c)</code> to the final answer, where <code>n</code> is the number of integers in <code>nums</code>.