Like most high security research facilities, many of the rooms in the Fitzpatrick require a secret number code to enter. Usually, a single passcode is given to all the users of a particular room. Unfortunately, in this day and age of camera phones and drones, it is easy for intruders to snoop on people entering in the passcode 1.
In an effort to thwart passcode snoopers, the building security team has
implemented a new passcode mechanism: instead of entering the whole passcode,
the user must enter in three random numbers from the original door code. For
instance, if the passcode was 2468135
, the user may be asked to enter in the
2nd
, 4th
, and 5th
numbers: 481
. This shorter sequence (2nd
, 4th
,
5th
) changes each time, so just watching the someone enter in the door code
will not guarantee entry to the snooper. Moreover, it helps prevent divulging
the complete passcode.
Being the black hat that you are, however, you decide that this security arrangement is weak and plan on cracking the code to the instructor's office 2. To do so, you have carefully monitored a series of successful entries and recorded them in a text file. Knowing that the three random numbers are always asked for in order and that the digits in the passcode are unique (due to limitations to the security software), your next step is to analyze these entries and produce the original passcode.
You will be given a series of successful entries where each entry is a three digit sequence:
352
154
542
315
152
The passcode for the above input is:
31542
To submit your work, follow the same procedure you used for Reading 00:
$ cd path/to/cse-30872-fa20-assignments # Go to assignments repository
$ git checkout master # Make sure we are on master
$ git pull --rebase # Pull any changes from GitHub
$ git checkout -b challenge18 # Create and checkout challenge18 branch
$ $EDITOR challenge18/program.cpp # Edit your code
$ git add challenge18/program.cpp # Stage your changes
$ git commit -m "challenge18: done" # Commit your changes
$ git push -u origin challenge18 # Send changes to GitHub
To check your code, you can use the .scripts/submit.py
script or curl:
$ .scripts/submit.py
Submitting challenge18 assignment ...
Submitting challenge18 code ...
Result Success
Score 6.00
Time 0.02
$ curl -F source=@challenge18/program.cpp https://dredd.h4x0r.space/code/cse-30872-fa20/challenge18
{"result": "Success", "score": 6, "time": 0.016332149505615234}
Once you have committed your work and pushed it to GitHub, remember to create a pull request and assign it to the appropriate teaching assistant from the Reading 09 TA List.