Inspired by the Puzzling-stackexchange post with the same name, which I've answered four years ago:
Can you create a perfectly valid English sentence, which makes perfect sense, but which contains the word "and" in it, five times consecutively in a row ?
"Something-or-other and and and and and something-else."
Let's say we have a store owner and his clerk. The store owner want the clerk to make a sign for the shop, which has the name (for example): "Toys And Puzzles".
So, the clerk makes the sign and presents it to the owner.
The owner thinks the spacing isn't really good. It currently looks something like:
Toys And Puzzles
but he wanted it to look more like:
Toys And Puzzles
So he says to the clerk:
"The spacing between Toys and And and And and Puzzles should be a bit larger. Could you please fix that?"
Given a string input, replace all occurrences of the word 'and' with five times that word; three in lowercase, interleaved with two of the original cased word.
and AND and AND and
and and and and and
and AnD and AnD and
There is one catch however (restricted-source):
You're not allowed to use the characters
aAnNdD in your source code. Any other character is still allowed, even if it's the unicode value of these letters, only these six characters themselves are banned.
- Your source code cannot contain any of the characters
- You can assume the input-string only contains spaces and letters (both lower- and uppercase)
- You can assume the input is non-empty
- It is possible that the input-string does not contain the word 'and', in which case it's returned as is
- Instead of a string you are also allowed to take the input as a list/array/stream of characters/code-point-integer (or other similar variations)
- Don't replace substrings of
andif it isn't a standalone word (see test cases with
- This is code-golf, so shortest answer in bytes wins.
Don't let code-golf languages discourage you from posting answers with non-codegolfing languages. Try to come up with an as short as possible answer for 'any' programming language.
- Standard rules apply for your answer with default I/O rules, so you are allowed to use STDIN/STDOUT, functions/method with the proper parameters and return-type, full programs. Your call.
- Default Loopholes are forbidden.
- If possible, please add a link with a test for your code (i.e. TIO).
- Also, adding an explanation for your answer is highly recommended.
Input: "Toys And Puzzles" Output: "Toys and And and And and Puzzles" Input: "and" Output: "and and and and and" Input: "AND and anD" Output: "and AND and AND and and and and and and and anD and anD and" Input: "Please stand over there and watch" # note that the "and" in "stand" isn't changed Output: "Please stand over there and and and and and watch" Input: "The crowd loves this band" # note that the "and" in "band" isn't changed Output: "The crowd loves this band" Input: "Toys and And and And and Puzzles" Output: "Toys and and and and and and And and And and and and and and and and And and And and and and and and and Puzzles" Input: "Mr Anderson went for a walk and found a five dollar bill" # note that the "And" in "Anderson" isn't changed Output: "Mr Anderson went for a walk and and and and and found a five dollar bill"