leetle

Daily challenge for 2026-01-21

386. Maximum Sum Subarray of Size K

Given an array of integers nums and an integer k, find the maximum sum of any contiguous subarray of size exactly k. You must use the two-pointers or sliding window technique.

Example:
Input: nums = [2, 1, 5, 1, 3, 2], k = 3
Output: 9 (The subarray [5, 1, 3] has the maximum sum 9)

Run this challenge interactively in Python or JavaScript when the app loads.