For each number in the sequence:
For each suffix (from longest to shortest) of the number as a string that the subsequence starts with:
append enough of the following subsequence numbers in the sequence to make a string long enough that the subsequence would fit in it
if the subsequence is in that string, you are done
这将完成大部分工作:
您需要跟踪每个序列号在“无限字符串”中的位置,并根据使用的后缀进行调整。在
相关问题 更多 >
编程相关推荐