Straddling checkerboard

FCC link

Implement functions to encrypt and decrypt a message using the straddling checkerboard method. The functions will take a string and an array as parameters. The array has 3 strings representing the 3 rows of the checkerboard. The output will be a series of decimal digits. Numbers should be encrypted by inserting the escape character before each digit, then including the digit unencrypted. This should be reversed for decryption.

Test

{{test}}

Console output