Is there an easy way to filter for pairs of the same last digit?

Say I have chosen 5 last digits and I want to only have 1 pair of matching last digits per combination.

Like this, last digits are 1, 2, 5, 7, 9. Whole numbers would be 1, 11, 21, 31 - 2, 12, 22, 32 - 5, 15, 25, 35 - 7, 17, 27, 37 - 9, 19, 29, 39.

Combinations should look like this - 1, 11, 22, 25, 37 or 1, 12, 22, 27, 39. Only 1 matching last digit pair per combination.

Thanks

Padawan