2004 AIME II Problem 4

How many positive integers less than 10,000 have at most two different digits?