The door that opens by itself
A safe uses a 4-digit code, from 0000 to 9999. You may type a sequence of digits as long as you like, one digit after another. The safe opens as soon as the last four digits typed match the correct code. What is the shortest sequence that i…