freeCodeCamp/curriculum/challenges/english/08-coding-interview-prep/project-euler/problem-79-passcode-derivat...

1.1 KiB

id challengeType title forumTopicId
5900f3bb1000cf542c50fece 5 Problem 79: Passcode derivation 302192

Description

A common security method used for online banking is to ask the user for three random characters from a passcode. For example, if the passcode was 531278, they may ask for the 2nd, 3rd, and 5th characters; the expected reply would be: 317. The text file, keylog.txt, contains fifty successful login attempts. Given that the three characters are always asked for in order, analyse the file so as to determine the shortest possible secret passcode of unknown length.

Instructions

Tests

tests:
  - text: <code>euler79()</code> should return 73162890.
    testString: assert.strictEqual(euler79(), 73162890);

Challenge Seed

function euler79() {
  // Good luck!
  return true;
}

euler79();

Solution

// solution required