Data Structures & AlgorithmsHardCodeforces Div2 C · GATE CS

For windows of size 2 over [4, 2, 12, 11, 5] (using 5 in place of -5), what is the largest window minimum?

  1. A. 12
  2. B. 5
  3. C. 10
  4. D. 11

Correct answer: D. 11

Compute each window's minimum and take the largest; the pair (12, 11) gives minimum 11, which beats every other adjacent pair.

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

Exams that ask this topic