Open In App

GATE | GATE CS 1997 | Question 61

Improve
Improve
Like Article
Like
Save
Share
Report

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


Last Updated : 25 Oct, 2017
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads