Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Solve in Javascript please. 1. Escape Room Keypads Problem Statement You're attempting to solve a puzzle in an Escape Room with your team where you

Solve in Javascript please.

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

1. Escape Room Keypads Problem Statement You're attempting to solve a puzzle in an Escape Room with your team where you need to open a door to get to the next stage. There are several doors, each with a different keypad on it. The keypads each have 7 keys, containing 7 distinct letters. Each keypad looks like this: Enter a word AELPSXY Enter The instructions state that one of the keypads will open the correct door leading to the next stage of the game. Your job is to find a word that unlocks the correct keypad. After struggling for some time, the Escape Room leader gave you a clue, that the first letter of the keypad is guaranteed to be in the word that opens Type here to search |A|EL|P|SX|Y Enter The instructions state that one of the keypads will open the correct door leading to the next stage of the game. Your job is to find a word that unlocks the correct keypad. After struggling for some time, the Escape Room leader gave you a clue, that the first letter of the keypad is guaranteed to be in the word that opens the door. We will call this letter the "key" letter. The goal of this exercise is to come up with as many words as possible that your team can test out on the keypads and find the correct combination to go the next stage of the game. What you know: The correct combination will be a valid English word. The words are at least 5 letters long, with no maximum length. The "key" letter will be in the correct answer. The words do not contain any letters outside the seven letters on the keypad. Letters may be reused, including the "key" letter. For our purposes, we'll express each set of keypad letters as a string of length 7, where the first letter Type here to search number of valid words in the corresponding lock. Constraints: Both the wordlist and the keypad letters will be supplied in all capital letters. All words in the wordlist will be of length 5 or greater. Every sequence of keypad letters will be of exactly length 7. Every sequence of keypad letters will consist of 7 distinct letters. Performance of your solution is important! A naive solution will not get you full points - to score 100/100, you'll need something significantly faster. Example Input: wordlist: ['APPLE', PLEAS', 'PLEASE'] keypads: ['AELWXYZ', 'AELPXYZ', 'AELPSXY', 'SAELPRT', 'XAEBKSY'] Expected output: [0, 1, 3, 2, 0] Evnlanation: Type here to search BI number of valid words in the corresponding lock. Constraints: Both the wordlist and the keypad letters will be supplied in all capital letters. All words in the wordlist will be of length 5 or greater. Every sequence of keypad letters will be of exactly length 7. Every sequence of keypad letters will consist of 7 distinct letters. Performance of your solution is important! A naive solution will not get you full points - to score 100/100, you'll need something significantly faster. Example Input: wordlist: ['APPLE', PLEAS', 'PLEASE'] keypads: ['AELWXYZ', 'AELPXYZ', 'AELPSXY', 'SAELPRT', 'XAEBKSY'] Expected output: [0, 1, 3, 2, 0] Evnlanation: Type here to search BI

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Business Process Driven Database Design With Oracle PL SQL

Authors: Rajeev Kaula

1st Edition

1795532386, 978-1795532389

More Books

Students also viewed these Databases questions

Question

What does Processing of an OLAP Cube accomplish?

Answered: 1 week ago