*Hard Words
Здравейте!
Не намерих във форума решена следната задача:
- *Hard Words
You will receive an array, which holds the string and another array.
The string is a letter from a young boy who does not yet know some words and you have to help him. The letter has a few holes, these holes are the words unknown to the boy and you must fill them with strings from the array you receive at the second index.
If the length of the hole is 4 you have to replace it with string with the same length and so on…
Examples
Input |
['Hi, grandma! I\'m so ____ to write to you. ______ the winter vacation, so _______ things happened. My dad bought me a sled. Mom started a new job as a __________. My brother\'s ankle is ________, and now it bothers me even more. Every night Mom cooks ___ on your recipe because it is the most delicious. I hope this year Santa will _____ me a robot.', |
Output |
Hi, grandma! I'm so glad to write to you. During the winter vacation, so amazing things happened. My dad bought me a sled. Mom started a new job as a pharmacist. My brother's ankle is sprained, and now it bothers me even more. Every night Mom cooks pie on your recipe because it is the most delicious. I hope this year Santa will bring me a robot. |
Не пиша нещо както трябва.
Ако може да ми предложите решение без regex.
Благодаря!
Много благодаря!! :)