You are viewing a single comment's thread. Return to all comments →
python3
def alternate(s): a=list(set(s)) ans=0 for x in range(len(a)-1): for y in range(1,len(a)-x): me=[a[x],a[x+y]] nit="" for t in s: if (t in me): if (nit=="" or t!=nit[-1]): nit+=t else: nit="" break if len(nit)>ans: ans=len(nit) return ans
Seems like cookies are disabled on this browser, please enable them to open this website
Two Characters
You are viewing a single comment's thread. Return to all comments →
python3