Available question text
Given a 4-digit combination lock starting at '0000', find the minimum number of single-digit rotations needed to reach a target combination while avoiding forbidden deadend combinations. Each digit (0–9) wraps around (9→0 and 0→9). Return -1 if the target is unreachable. This is a shortest-path problem in an implicit graph of 10^4 states with forbidden nodes, best solved using BFS or bidirectional BFS.
Related questions
Continue with questions that share topics or the same question type.
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 2 records
Brex
LeetCode 752. Open the Lock
Reported Mar 9, 2026 · 1 source report
SENIOR
Source snapshot: Nov 12, 2026
View sourceMeta
LeetCode 752. Open the Lock
Reported Sep 19, 2025 · 2 source reports
MID_LEVEL, SENIOR
Source snapshot: Nov 12, 2026
View source