You are viewing a single comment's thread. Return to all comments →
**we need to find how many r mismatched with SOS so just iterate through 3 bits and check those 3 bits only **
def marsExploration(s): k=0
for i in range(0,len(s)-2,3): if s[i]!='S': k=k+1 if s[i+1]!='O': k=k+1 if s[i+2]!='S': k=k+1 #k=len(s)//3 return k
Seems like cookies are disabled on this browser, please enable them to open this website
Mars Exploration
You are viewing a single comment's thread. Return to all comments →
**we need to find how many r mismatched with SOS so just iterate through 3 bits and check those 3 bits only **
def marsExploration(s): k=0