The Current app uses a four-wheel security lock for a protected flow. The lock starts at "0000". Each turn increments or decrements exactly one wheel, with digits wrapping from 9 to 0 and from 0 to 9.
Given a list of forbidden lock combinations and a target combination, return the minimum number of turns needed to reach the target from "0000". Return -1 if the target cannot be reached. A forbidden combination cannot be entered, including the starting combination.
Implement open_lock(deadends, target).
deadends is a list of unique four-character strings containing digits 0 through 9.target is a four-character string containing digits 0 through 9.-1 when no valid sequence exists.+1 or -1, with wraparound.def open_lock(deadends, target):