You are viewing a single comment's thread. Return to all comments →
Thanks for the simple solution. I especially found the 3rd pass to be verify useful (that was the 'aha' moment for me):
if l[i - 1][0] == l[i + 1][0] and l[i][1] == 1: ans += min(l[i - 1][1], l[i + 1][1])
if l[i - 1][0] == l[i + 1][0] and l[i][1] == 1:
ans += min(l[i - 1][1], l[i + 1][1])
Seems like cookies are disabled on this browser, please enable them to open this website
Special String Again
You are viewing a single comment's thread. Return to all comments →
Thanks for the simple solution. I especially found the 3rd pass to be verify useful (that was the 'aha' moment for me):