def solution(message:str, nums: list)-> int:
# your code here
new_list = [str(nums[i] - (ord(message[i])-96)) for i in range(len(nums)) ]
length = len(nums)
for i in range(1,length+1):
if (new_list[:i]*length)[:length] == new_list:
return int(''.join(new_list[:i]))
def solution(message:str, nums: list)-> int:
encrypt = [value - ord(message[index]) + 96 for index,value in enumerate(nums)]
guess =0
ln=len(encrypt)
while guess <ln:
pairs=ln//(guess+1)
if pairs == 1 and encrypt[guess+1:] == encrypt[:ln-guess-1]:
return int(''.join([str(i) for i in encrypt[:guess+1]]))
elif pairs == 1 and encrypt[guess+1:] != encrypt[:ln-guess-1]:
guess +=1
elif pairs > 1:
for count in range(2,pairs+1):
if encrypt[:guess+1] != encrypt[(guess+1)*(count-1):(guess+1)*count]:
guess += 1
break
else:
return int(''.join([str(i) for i in encrypt[:guess+1]]))