zz 史上最难“连连看”游戏:“韩国小姐”登录iOS# Joke - 肚皮舞运动
x*h
1 楼
题目是Given a dictionary,design an algorithm to find the optimal way of "
unconcatenating" a sequence of words. "optimal" is defined to be the
parsing which minimizes the number of unrecognized sequences of characters.
比如:
“jesslookedjustliketimeherbrother”
->"JESS looked just like TIM her brother" 在这里JESS和TIM是没有被识别的
前面解释看懂了,但是看不懂implement的那段code,有没有做过的人指点一下啊?
wordStart,wordEnd指的是什么啊,初始值是0,0?
还有bestExact,和bestExtend具体指的什么部分呢?
非常感谢!
unconcatenating" a sequence of words. "optimal" is defined to be the
parsing which minimizes the number of unrecognized sequences of characters.
比如:
“jesslookedjustliketimeherbrother”
->"JESS looked just like TIM her brother" 在这里JESS和TIM是没有被识别的
前面解释看懂了,但是看不懂implement的那段code,有没有做过的人指点一下啊?
wordStart,wordEnd指的是什么啊,初始值是0,0?
还有bestExact,和bestExtend具体指的什么部分呢?
非常感谢!