Consecutive Sub Sequence

A collection of 1 post

Consecutive Sub Sequence

Problem You are given a sequence of N numbers. Write a program to count how many times in this sequence the sum of consecutive subsequences is a specific number M. If N=8, M=6 and the sequence is There are three consecutive subsequences whose sum is 6: {2, 1, 3}, {1, 3, 1, 1}, and {3, 1, 1,…