You are viewing a single comment's thread. Return to all comments →
My solution in python:
def marsExploration(s): nChanged = 0 for i, value in enumerate(s): remainder = i % 3 if remainder in (0, 2) and value != "S": nChanged += 1 elif remainder == 1 and value != "O": nChanged += 1 return nChanged
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 →
My solution in python: