Feb-12-2020, 01:26 AM
(This post was last modified: Feb-12-2020, 01:27 AM by BladedSupernova.)
Ok i refactored it to hell, code is super small. See below. But I still wonder am I doing it wrong? - Can the code be smaller? The code functions as desired and is fast and the memory issue is expected.
e=[''] g=4 for count2 in range(2): f='ababa'[count2:g] g=g+1 c=1 d=1 for count in range(4): a=f[count-1] b=e[d-1].find(a)+1 if b==0: e[d-1]=str(e[d-1])+str(a) if d==len(e): e.append([]) e[d].append(len(e)+1) e.append('') d=len(e) else: d=e[d][b-1] print(e)[b][/b]