• + 0 comments

    return sum(1 for x in range(len(s)) if sum(s[x:x+m]) == d and len(s[x:x+m]) == m )