Data Structures & AlgorithmsHardAmazon OA · Arrays

A sliding window of size 3 moves over [1, 3, -1, -3, 5, 3, 6, 7]. What is the sum of the window maximums?

  1. A. 29
  2. B. 26
  3. C. 31
  4. D. 23

Correct answer: A. 29

Window maxima are 3, 3, 5, 5, 6, 7, which sum to 29.

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

Exams that ask this topic