编程介的小学生 2017-04-17 16:33 采纳率: 20.5%
浏览 756
已采纳

Keep Deleting

Assume that string A is the substring of string B if and only if we can find A in B, now we have a string A and another string B, your task is to find a A in B from B's left side to B's right side, and delete it from B till A is not a substring of B, then output the number of times you do the delete.

There are only letters(A-Z, a-z) in string A and B.

Input

This problem contains multiple test cases. Each case contains two line, the first line is string A, the second line is string B, the length of A is less than 256, the length of B is less than 512000.

Output

Print exactly one line with the number of times you do the delete for each test case.

Sample Input

abcd
abcabcddabcdababcdcd
Sample Output

5
Hint

abcabcddabcdababcdcd delete=0
abcdabcdababcdcd delete=1
abcdababcdcd delete=2
ababcdcd delete=3
abcd delete=4
delete=5

  • 写回答

2条回答 默认 最新

  • threenewbee 2017-04-18 15:45
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 按键修改电子时钟,C51单片机
  • ¥60 Java中实现如何实现张量类,并用于图像处理(不运用其他科学计算库和图像处理库))
  • ¥20 5037端口被adb自己占了
  • ¥15 python:excel数据写入多个对应word文档
  • ¥60 全一数分解素因子和素数循环节位数
  • ¥15 ffmpeg如何安装到虚拟环境
  • ¥188 寻找能做王者评分提取的
  • ¥15 matlab用simulink求解一个二阶微分方程,要求截图
  • ¥30 乘子法解约束最优化问题的matlab代码文件,最好有matlab代码文件
  • ¥15 写论文,需要数据支撑