• + 5 comments

    Here is Python 3 solution from my HackerrankPractice repository:

    n, s = int(input().strip()), list(map(int, input().split()))
    d, m = map(int, input().split())
    print(sum([sum(s[i : i + m]) == d for i in range(len(s) - m + 1)]))
    

    Feel free to ask if you have any questions :)