ABC098B-python

コード

n=int(input())
s=input()
count=0
for i in range(n):
  tmp=0
  a=s[0:i]
  b=s[i:]
  for v,j in enumerate(a):
    if j in b and not j in a[0:v] :
      tmp += 1
  if tmp > count:
    count = tmp
print(count)

 

python君は文字列に対して直接forループ掛けれることを忘れていた。