You are viewing a single comment's thread. Return to all comments →
def marsExploration(s): altered_count = 0 for i in range(0, len(s), 3): if s[i] != 'S': altered_count += 1 if s[i + 1] != 'O': altered_count += 1 if s[i + 2] != 'S': altered_count += 1 return altered_count
s = "SOSSPSSQSSOR" print(marsExploration(s)) # Output: 3
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 →
Example usage:
s = "SOSSPSSQSSOR" print(marsExploration(s)) # Output: 3