Steganography hides a given message inside a given carrier, producing a package that does not look suspicious. For this challenge, you will write a program that takes an ASCII message and an ASCII carrier as input, and return or print a package that is identical to the carrier except characters corresponding to the message are doubled, in the same order that they appear in the message.
- If the carrier already contains sequences of the same character more than once, and they are not used to encode a character of the message, the program will reduce them to a single character.
- If the carrier does not contain the message characters in the right order, the program may return nothing, the carrier itself, or an error.
- You may assume that the message and carrier are non-empty ASCII strings.
- Capitalization matters: A is not equivalent to a.
- When more than one package is valid, your program may output any or all of them.
- Space is a character like any other character.
Message Carrier Package "hi" "has it arrived?" "hhas iit arived?" OR "hhas it ariived?" "sir" "has it arrived?" "hass iit arrived?" "foo" "has it arrived?" "" OR "has it arrived?" OR an error. "Car" "Cats are cool." "CCaats arre col." "car" "Cats are cool." "" OR "Cats are cool." OR an error. "Couch" "Couch" "CCoouucchh" "oo" "oooooooooo" "oooo" "o o" "oooo oooa" "oo ooa"
This is code golf, so fewest bytes wins.