S = "ababcbacadefegdehijhklij"
j = 0
start = 0
lastOccurence = {}
for idx, val in enumerate(S):
    lastOccurence[val] = idx
    
result = []
for idx,val in enumerate(S):
    j = max(j, lastOccurence[val])
    if idx == j:
        result.append(idx - start + 1)
        start = idx + 1
print(result)

fcc15a38f1d3c6f8b2aeeef6b1c089e590554994
<mask token>

<mask token>
for idx, val in enumerate(S):
    lastOccurence[val] = idx
<mask token>
for idx, val in enumerate(S):
    j = max(j, lastOccurence[val])
    if idx == j:
        result.append(idx - start + 1)
        start = idx + 1
print(result)

S = 'ababcbacadefegdehijhklij'
j = 0
start = 0
lastOccurence = {}
for idx, val in enumerate(S):
    lastOccurence[val] = idx
result = []
for idx, val in enumerate(S):
    j = max(j, lastOccurence[val])
    if idx == j:
        result.append(idx - start + 1)
        start = idx + 1
print(result)

S = "ababcbacadefegdehijhklij"
j = 0
start = 0
lastOccurence = {}
for idx, val in enumerate(S):
    lastOccurence[val] = idx
    
result = []
for idx,val in enumerate(S):
    j = max(j, lastOccurence[val])
    if idx == j:
        result.append(idx - start + 1)
        start = idx + 1
print(result)
