Find minimum time for irrecoverable password | Amazon Interview Question