<p>You have a lock in front of you with 4 circular wheels. Each wheel has 10 slots: <code>'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'</code>. The wheels can rotate freely and wrap around: for example we can turn <code>'9'</code> to be <code>'0'</code>, or <code>'0'</code> to be <code>'9'</code>. Each move consists of turning one wheel one slot.</p>
<p>The lock initially starts at <code>'0000'</code>, a string representing the state of the 4 wheels.</p>
<p>You are given a list of <code>deadends</code> dead ends, meaning if the lock displays any of these codes, the wheels of the lock will stop turning and you will be unable to open it.</p>
<p>Given a <code>target</code> representing the value of the wheels that will unlock the lock, return the minimum total number of turns required to open the lock, or -1 if it is impossible.</p>
A sequence of valid moves would be "0000" ->"1000" ->"1100" ->"1200" ->"1201" ->"1202" ->"0202".
Note that a sequence like "0000" ->"0001" ->"0002" ->"0102" ->"0202" would be invalid,
because the wheels of the lock become stuck after the display becomes the dead end "0102".