Solve Leetcode Problems and Get Offers From Your Dream Companies
Problem number 752. Open the Lock (BFS/Graph)
In this series, I am going to solve Leetcode medium problems live with my friends, which you can see on our youtube channel, Today we will do Problem Problem 22. Generate Parentheses.
A little bit about me, I have offers from Uber India and Amazon India in the past, and I am currently working for Booking.com in Amsterdam.
Motivation to learn algorithms
Problem Statement
You have a lock in front of you with 4 circular wheels. Each wheel has 10 slots: '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'
. The wheels can rotate freely and wrap around: for example, we can turn '9'
to be '0'
, or '0'
to be '9'
. Each move consists of turning one…