GATE | GATE CS 1997 | Question 61

An array A contains n≥1 positive integers in the locations A[1], A[2],… A[n]. The following program fragment prints the length of a shortest sequence of consecutive elements of A, A[i], A[i+1],…A[j] such that the sum of their values is ≥M, a given positive number. It prints ‘n+1’ if no such sequence exists. Complete the program by filling in the boxes. In each case use the simplest possible expression. Write only the line number and the contents of the box.
ccc


Answer:

Explanation:

Quiz of this Question



My Personal Notes arrow_drop_up


Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.