The Problem:
Two enemy secret agents have devised a wonderful (for you) method of communication!
Here’s how the encryption process works:
1) Take the ascii equivalents of each letter. (No spaces, numbers, or punctuation are sent)
2) For each letter in the message, the ascii equivalent of it and the letter after it (If it exists, if it doesn’t, it should be considered 0), are multiplied (this product is stored in an array/list) and summed (this number is also stored in a different list).
3) The two lists (of sums and products) are joined together (the sums list, then the multiples list, into the same array) and transmitted.
You need to write the smallest program able to reverse this process and decrypt messages sent in this format!
Example Input and Output Pairs:
[173, 209, 216, 219, 198, 198, 225, 222, 208, 100, 7272, 10908, 11664, 11988, 9657, 9657, 12654, 12312, 10800, 0] -> “HelloWorld”
[131, 133, 164, 195, 197, 99, 4290, 4422, 6499, 9506, 9702, 0] -> “ABCabc”
This is code-golf, so the smallest solution in bytes wins.
Error messages are allowed.
Your program can be given either a list/1-dimensional array or a comma-separated string, if you specify in your submission. The default is an array/list.