Clock Lock - Save the World, Time Traveler! :)
Description:
You traveled back from the future to save the world. You must get a password to prevent a nuclear apocalypse.
You have succesfully got into the system by an exploit which was published just in the future. You have access to the checkpwd() method, and with this you can check that a password is valid or not. But unfortunatelly you have limited access to the system and you cannot use the followings:
- import
- class
- the "" and "_" symbols
- exec
- eval
- getattr
- globals
- locals
- dir
Before you traveled back to the past, you got some information about the system:
- you can use the timeit module
- the password is a 20 character long hexadecimal string (lowercase)
- they check the passwords very slowly, character by character. At a wrong character the checkpwd() method immediately returns with False value.
Write a getpwd() function which returns with the correct password. Good Luck!
Note: Measure the time! Maybe better to try your function in your own computer before you try it here. Don't worry if the test fails first time, maybe just the measurements were wrong, try to validate again :)
Similar Kata:
Stats:
Created | May 22, 2018 |
Published | May 22, 2018 |
Warriors Trained | 87 |
Total Skips | 26 |
Total Code Submissions | 132 |
Total Times Completed | 11 |
Python Completions | 11 |
Total Stars | 1 |
% of votes with a positive feedback rating | 83% of 3 |
Total "Very Satisfied" Votes | 2 |
Total "Somewhat Satisfied" Votes | 1 |
Total "Not Satisfied" Votes | 0 |
Total Rank Assessments | 3 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 5 kyu |
Lowest Assessed Rank | 6 kyu |