Find the minimum number of wheel turns to reach a target combination, avoiding deadends.
Constraints
Example
>>> openLock(["0201","0101","0102","1212","2002"], "0202") 6 >>> openLock(["8888"], "0009") 1 >>> openLock(["8887","8889","8878","8898","8788","8988","7888","9888"], "8888") -1
Recent Submissions
No submissions yet — hit Run Tests to try!
Hints