Maximum in Each Window

Talk it through with a coach who asks guiding questions and gives hints until you reach the answer. Pass to mark the challenge as completed.

The problem

  • hard
  • Pro

Given a list of numbers and a window size k, report the largest number in every window of k consecutive numbers as the window slides from left to right. Explain how to do it in linear time.

Talk this problem through with an AI coach

This is a Pro challenge. Sign in with Google, then upgrade to start a voice session.

Start free →