Cipher Crossword Cipher Crossword
Moderate
English ES RU

Everyone has tried solving a crossword puzzle at some point in their lives. We're going to mix things up by adding a cipher to the classic puzzle. A cipher crossword replaces the clues for each entry with clues for each white cell of the grid. These clues are integers ranging from 1 to 26, inclusive. The objective, as any other crossword, is to determine the proper letter for each cell. In a cipher crossword, the 26 numbers serve as a cipher for those letters: cells that share matching numbers are filled with matching letters, and no two numbers stand for the same letter. All resulting entries must be valid words.

For this task you should solve the cipher crossword. You are given a crossword template as a list of lists (2D array) with numbers (from 0 to 26), where 0 is a blank cell and other numbers are encrypted letters. You will be given a list of words for the crossword puzzle. You should fill that template with a given word and return the solved crossword as a list of lists with letters. Blank cells are replaced with whitespaces (0 => " ").

The words are placed in rows and columns with NO diagonals. The crossword contains six words with 5 letters each. These words are placed in a grid.

cipher-crossword cipher-crossword

Input: The Cipher Crossword as a list of lists with integers. Words as a list of strings.

Output: The solution to the Crossword as a list of lists with letters.

Example:

checkio(
    [
        [21, 6, 25, 25, 17],
        [14, 0, 6, 0, 2],
        [1, 11, 16, 1, 17],
        [11, 0, 16, 0, 5],
        [26, 3, 14, 20, 6]
    ],
    ['hello', 'habit', 'lemma', 'ozone', 'bimbo', 'trace']
) == [['h', 'e', 'l', 'l', 'o'],
      ['a', ' ', 'e', ' ', 'z'],
      ['b', 'i', 'm', 'b', 'o'],
      ['i', ' ', 'm', ' ', 'n'],
      ['t', 'r', 'a', 'c', 'e']]

How it is used: This is a type of restriction problem. You have rules and should try to find a combination that conforms to these rules. This concept can help you to solve scheduling conflicts and - a situation where you would encounter many variables and restrictions, among other things.

Precondition:
|crossword| = 5x5
∀ x ∈ crossword : 1 ≤ x ≤ 26

Settings
Code:
CheckiO Extensions

CheckiO Extensions allow you to use local files to solve missions. More info in a blog post.

In order to install CheckiO client you'll need installed Python (version at least 3.8)

Install CheckiO Client first:

pip3 install checkio_client

Configure your tool

checkio --domain=py config --key=

Sync solutions into your local folder

checkio sync

(in beta testing) Launch local server so your browser can use it and sync solution between local file end extension on the fly. (doesn't work for safari)

checkio serv -d

Alternatevly, you can install Chrome extension or FF addon

checkio install-plugin
checkio install-plugin --ff
checkio install-plugin --chromium

Read more here about other functionality that the checkio client provides. Feel free to submit an issue in case of any difficulties.

×
 
 
<< <
> >>
exec

Whats Next?

Free accounts will see Best CheckiO solutions with some delay.
Best Solutions will be opened in
Become Awesome and Don't wait
The next stage is ""
Will be activated in
View More Solutions Random Review Solutions Share your own solution
Go to the next mission Back to the list of missions Back to the map