TikTok interview question

leetcode problem 752. Open the Lock