Advertisement
didkoslawow

Untitled

Feb 21st, 2023
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function rosettaStone(input) {
  2.     const templateRows = Number(input.shift());
  3.     const templateMatrix = [];
  4.    
  5.     for (let i = 0; i < templateRows; i++) {
  6.         let currentRow = input.shift().split(' ');
  7.             currentRow = currentRow.map(Number)
  8.         templateMatrix.push(currentRow);
  9.     }
  10.  
  11.     const encodedMatrix = input.map((row) => row.split(' ').map((x) => Number(x)));
  12.    
  13.     const letterDecipher = letterCipher => {
  14.         let num = letterCipher;
  15.         if (letterCipher >= 27) {
  16.             num = letterCipher % 27;
  17.         }
  18.  
  19.         let letter = ' ';
  20.  
  21.         if (num > 0) {
  22.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement