Data Structures & AlgorithmsVery hardGATE CS · TCS NQT

What is the sum of the minimum of every contiguous window of size 4 in [8, 2, 6, 1, 9, 3, 7]?

  1. A. 5
  2. B. 4
  3. C. 8
  4. D. 35

Correct answer: B. 4

Each of the four windows of size 4 contains the value 1 (at index 3), so every window minimum is 1 and the sum is 4.

More Arrays, Strings, Linked Lists, Stacks, Queues and Hashing questions

Exams that ask this topic