← Back to List

16446번: Enigma ↗

Solutions

Python 3
591 B | 591 chars
import sys
from math import sqrt, pi, sin, factorial, ceil, floor

BLANK = " "

inp = input
# inp = lambda : sys.stdin.readline()[:-1].strip()
mii = lambda x = BLANK : [*map(int,inp().split(x))]
mfi = lambda x = BLANK : [*map(float,inp().split(x))]
ii = lambda : int(inp())
fi = lambda : float(inp())
p = print

def solve():
  a = input()
  b = input()

  cnt = 0
  for i in range(0, len(a) - len(b) + 1):
    for j in range(len(b)):
      if a[i + j] == b[j]:
        break
    else:
      cnt += 1
  p(cnt)

if __name__ == "__main__":
  tc = 1

  for t in range(1, tc+1):
    ret = solve()