Your task is to make the smallest function/program that can, when gives an number N, return/print:
the number of possible choices
a, b such that \$1 \leq a < b < N\$ and
b have exactly one common digit in base 10 (there exists a digit, and only one digit, which appears both in
b, for example 12 and 23, where 2 appears both in 23 and in 12)
note - 1 and 11 count as having exactly one common digit, as 1 is a digit which appears in both of them, and it's the only one that appears in both of them.
You function/program should work for all n from 1 to 1000.
20 -> 63 40 -> 267 60 -> 575 80 -> 987 100 -> 1503 1000 -> 235431
This is a code golf so the lowest score in bytes wins. Good luck!