Back to problems

Escape Room Lock Chain

Algorithm · Pinterest · Medium

Problem You are given clues collected in an escape room and a list of locked doors or containers. Determine whether the available clues allow every lock to be opened. A lock can be opened when its required clue appears in clues. Return true only if each entry in locks has a matching entry in clues; otherwise, return false. Examples Input: clues = ["moon", "keycard", "mirror"], locks = ["mirror", "moon"] Output: true Explanation: Both required lock clues, mirror and moon, are…

Checking your access…