Cover Array With Restricted Operations by gobi

e=lambda _:list(input().split())
while 1:
 A=e(1);B=e(1);k=0
 for b in range(99):
  a=A;c=0
  for o in B[b:]:
   if o in a:a=a[a.index(o)+1:];c+=1
   else:break
  k=max(c,k)
 print(len(A)-k)

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

To protect the system from spam, please input your favorite sport (hint: I believe its name must start with 'g', case insensitive)

download

return to the top page