Mars Exploration

  • + 0 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