Merge branch 'master' of tea.maggioni.xyz:Working-FFS/ProgrammingChallenges

This commit is contained in:
Claudio Maggioni 2019-09-12 21:59:45 +02:00
commit ed6a127ce3
1 changed files with 39 additions and 0 deletions

39
repeater.py Normal file
View File

@ -0,0 +1,39 @@
def __main__():
T = int(input())
for i in range(1, T + 1):
N = int(input())
A = [None] * N
for j in range(0, N):
A[j] = input()
print("Case #" + str(i) + ": " + str(repeater(A)))
def repeater(arr):
count_arr = [0] * len(arr)
c = 0
while ???:
s = 0
tmpChar = arr[0][count_arr[0]]
for i in range(0, len(arr)):
string = arr[i]
while string[count_arr[i] + 1] == tmpChar:
count_arr[i] += 1
s += 1
else:
return "Fegla Won"
sorted = sort(count_arr)
if len(sorted) % 2 == 1:
k = len(sorted) - 1 / 2
for count in count_arr:
c += abs(count - sorted[k])
else:
v = 0
bonatti = len(sorted) / 2
k2 = everest - 1
for count in count_arr:
c += abs(count - sorted[k])