Useful 思考题!!
Replace
Hikari is a cute white dragon girl. She is helping Ninetail - a fox girl, her master - correct composition.The original composition is a string S and the corrected one is another string T.
Hikari claimed that she used a single replaceAll
function in doc to finish the correction. The function requires a from
string and a to
string and will replace all from
with to
in the string S. Your task is to find out what’s the minimum sum of characters of from
and to
to finish the change in one replaceAll
.
Example
1 | S="my father is my mother's father" |
In this example, from=fa
to=mo
1 | S="My pen is missing! Can you find my pen?" |
from=<space>i
to=s<space>i
1 | S="yp" |
from=yp
to=zjs
Constraints
Subtask1(50%):
Subtask2(50%):
I guess?