You are viewing a single comment's thread. Return to all comments →
def alternatingCharacters(s): lp=count=0 rp=1 while lp<len(s) and rp<len(s): if s[lp]==s[rp]: count+=1 lp+=1 rp+=1 return count
def alternatingCharacters(s):
lp=count=0 rp=1 while lp<len(s) and rp<len(s): if s[lp]==s[rp]: count+=1 lp+=1 rp+=1 return count
Seems like cookies are disabled on this browser, please enable them to open this website
Alternating Characters
You are viewing a single comment's thread. Return to all comments →