in this exam, we had to complete a piece of code - which i'll display here.
we tried to complete it, yet we didn't undertand what is the power needed for.
isn't it possible to complete it with a single line:
for i in range(1,len(string)):
new_fingerprint = f[i-1] +string[-i-1]*basis**i%r
def suff_fingerprint(string, basis=2 ** 16, r=2 ** 32-3):
f = [ ord(string[-1]) % r ] power = 1
list.append(f,new_fingerprint)#append f[s] to existing f