fork download
  1. # Problem Link - https://c...content-available-to-author-only...s.com/problemset/problem/625/B
  2.  
  3. s = input()
  4. s1 = input()
  5.  
  6. count = 0
  7. if len(s1) > len(s):
  8. print(0)
  9. else:
  10. found = 0
  11. st = -1
  12. for i in range(len(s)):
  13. if found < len(s1) and s[i] == s1[found]:
  14. found += 1
  15. elif found < len(s1) and s[i]!=s1[found]:
  16. found = 0
  17. if found < len(s1) and s[i] == s1[found]:
  18. found += 1
  19. if found == len(s1):
  20. count += 1
  21. found = 0
  22. # print(count,s[i])
  23. print(count)
  24.  
Success #stdin #stdout 0.02s 9220KB
stdin
uiuiuier
uier
stdout
1