Orange Boy Can You Solve It Out? Ep. 45
From Hexo
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
S="my father is my mother's father"
T="my mother is my mother's mother"
output=4
In this example, from=fa
to=mo
S="My pen is missing! Can you find my pen?"
T="My pens is missing! Can you find my pen?"
output=5
from=<space>i
to=s<space>i
S="yp"
T="zjs"
output=5
from=yp
to=zjs
Constraints
Subtask1(50%): {%mathjax%}1\leq |S|,|T| \leq 50{%endmathjax%}
Subtask2(50%): {%mathjax%}1\leq |S|,|T| \leq 200{%endmathjax%}
I guess?
版权声明:
作者:XGN
链接:https://blog.hellholestudios.top/archives/508
来源:Hell Hole Studios Blog
文章版权归作者所有,未经允许请勿转载。
共有 0 条评论