Launching the Dropbox mobile app on the VIU's tablet requires a four-digit passcode. To ensure the confidentiality of the stored information, the device is locked out of Dropbox after
10
consecutive failed passcode attempts.
Despite this security, our VIU doesn't trust anyone and is a little paranoid that someone might bypass the passcode. As a precaution, he has asked you to implement a function that checks to see if
10
or more consecutive failed passcode attempts were made.
Example
- For
passcode = "1111"
and
attempts = ["1111", "9999",
"9999", "9999",
"9999", "9999",
"9999", "9999",
"9999", "9999",
"9999", "1111"]
the output should be
incorrectPasscodeAttempts(passcode, attempts) = true
;- For
passcode = "1111"
andattempts = []
, the output should beincorrectPasscodeAttempts(passcode, attempts) = false
.
- [input] string passcodeString consisting of exactly
4
digits representing the correct passcode. - [input] array.string attemptsArray representing the passcode attempts in the order they were made. Each element of
attempts
is a string consisting of exactly4
digits. - [output] boolean
true
if10
or more consecutive failed passcode attempts were made,false
otherwise.
0 comments :
Post a Comment