Special String Again

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