Count three-digit numbers with distinct digits | Meta Interview Question