Euler Solution 79

From ProgSoc Wiki

Jump to: navigation, search

Solutions for Problem 79

NOTE: Easter egg again, once again not mentioned or linked from the main page.

Analysing the keylog from login where a user is asked for 3 digits from a code (always ordered left to right), can you work out the code?

Pen and Paper by SanguineV

Runtime: about a minute

Note that digits in braces in progressive solution may be reordered.

Steps:

  1. Start with first code: 319
  2. Second and third share two digits "80": (3{6)1}(89)0
  3. Fifth adds "2" between 1 and 9: (3{6)1}[2(8]9)0
  4. Seventh adds "7" before "6": [7(3]{6)1}[2(8]9)0
  5. Eight orders "8" and "9": [7(3]{6)1}(28)90
  6. Eleven orders "3" and "6": (73)(61)(28)90
  7. Sixteen orders "6" and "1": (73)16(28)90
  8. Seventeen orders "7" and "3": 7316(28)90
  9. Thirty four orders "2" and "8": 73162890

No doubt a computer can solve it in milliseconds, but coding it takes longer. It took me longer to write up the solution than to solve it!

Personal tools