IMO 1969 LL MON40

Find the number of five-digit numbers with the following

IMO 1969 LL MON40

Origin: MON

Problem

Find the number of five-digit numbers with the following properties: there are two pairs of digits such that digits from each pair are equal and are next to each other, digits from different pairs are different, and the remaining digit (which does not belong to any of the pairs) is different from the other digits.