You are viewing a single comment's thread. Return to all comments →
A faster version using itertools.cycle:
from itertools import cycle print(sum(1 for i, j in zip(input(), cycle("SOS")) if i != j))
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 →
A faster version using itertools.cycle: