Panasonic Hiring | Off-Campus OA (2022) | Maximum Average Subarray I Problem

Question · Posted Jun 2026

Problem Statement Given an integer array nums consisting of n elements and an integer k, find the contiguous subarray of length k that has the maximum average value. Return the maximum average. The answer will be accepted if it is within 10^-5 of the actual answer. Example Input nums = [1,12,-5,-6,50,3] k = 4 Output 12.75

The full answer & interview discussion are available to premium members.

Log in Create a free account