def foo(a):
uniqe = set(a)
firstX = list(a).index("A")
b = a[firstX:].replace("X", "")
output = []
counter = [0]
for char in uniqe:
if b.count(char) > max(counter):
counter.clear()
counter.append(b.count(char))
output.clear()
output.append(char)
elif b.count(char) == max(counter):
counter.append(b.count(char))
output.append(char)
print(counter)
return output
fileAll = open('24-164.txt', "r").readlines()
for j in open('24-164.txt'):
print(j)
count=0
for i in fileAll:
x=i.index('X')
count+=i[x::].count('A')
# fileAll = open('sss.txt', "r")
print(count)
output = []
for line in fileAll:
# print(line[:-2])
# for line in file:
for elem in foo(line[:-2]):
output.append(elem)
# print(output)
s = ''.join(output)
# print(s)
m=foo(s)
# print(sorted(output))
# print(output.count(foo(s)[0]))