Without any proper dictionary, I guess I'll stick to the "bruteforce" method! Here's how it works:
First, build an Array containing numbers from 26 to 1 ([...Array(26)].map((_,i)=>26-i))
Print the current index (26-n) and the cipher (s)
Build the associated original text: For each character, if its charCode is between 97 and 122 (hence, if it is a valid lowercase character), add the current index to it, else just return it.
Here we go:
Without any proper dictionary, I guess I'll stick to the "bruteforce" method! Here's how it works:
[...Array(26)].map((_,i)=>26-i)
)26-n
) and the cipher (s
)