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.
Answer:
Explanation:
Quiz of this Question
Last Updated :
25 Oct, 2017
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...