Lock Picker
Problem Description
You are working as a professional lock maker
for a bank. You design electronic locks which
are difficult to break. The lock consists of a
specific number of digits. The locks are such
that a proper sequence needs to be followed
while unlocking the lock. If not, we might be
stuck in a deadlock. This means that the lock is
jammed and we can not try opening the lock
once we are in a deadlock. Unfortunately, the
bank lost the sequence that needs to be
followed an asks for your help
You are given with 2 strings startState and
finalState denoting the initial sequence of
digits and the sequence of digits that unlocks
the lock Both startState and finalState are of
the same length you are given with an array of
strings deadlock of size n denoting the number
of deadlock sequences. Each deadlock() has
the same length as that of startState and
finalstate The Lookiscicou You can either
increase a diot on decrease a choimhach
change takes 1 second Your tasks to find the
malinnum time which we can reach the
inaustate from stantsitate output if it is not
possible to each nedbate te due to deadlocks
NPUT FORMAT
hesten out contains a string
Answers
Answer:
Lock Picker
Problem Description
You are working as a professional lock maker
for a bank. You design electronic locks which
are difficult to break. The lock consists of a
specific number of digits. The locks are such
that a proper sequence needs to be followed
while unlocking the lock. If not, we might be
stuck in a deadlock. This means that the lock is
jammed and we can not try opening the lock
once we are in a deadlock. Unfortunately, the
bank lost the sequence that needs to be
followed an asks for your help
You are given with 2 strings startState and
finalState denoting the initial sequence of
digits and the sequence of digits that unlocks
the lock Both startState and finalState are of
the same length you are given with an array of
strings deadlock of size n denoting the number
of deadlock sequences. Each deadlock() has
the same length as that of startState and
finalstate The Lookiscicou You can either
increase a diot on decrease a choimhach
change takes 1 second Your tasks to find the
malinnum time which we can reach the
inaustate from stantsitate output if it is not
possible to each nedbate te due to deadlocks
NPUT FORMAT
hesten out contains a string