Wednesday, 18 May 2016

DropBox Problem

Image result for dropbox imageOne Very Important User (VIU) has a Very Confidential Document (VCD) stored in his Dropbox account. He doesn't let anyone see the VCD, especially his roommates who often have free access to his mobile devices and laptop.
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" and attempts = [], the output should be
    incorrectPasscodeAttempts(passcode, attempts) = false.
  • [input] string passcode
    String consisting of exactly 4 digits representing the correct passcode.
  • [input] array.string attempts
    Array representing the passcode attempts in the order they were made. Each element of attempts is a string consisting of exactly 4 digits.
  • [output] boolean
    true if 10 or more consecutive failed passcode attempts were made, falseotherwise.

0 comments :

Post a Comment