Maximum Sum Subarray of Size K

Given an integer array nums and an integer $k$, return the maximum sum obtainable from any contiguous subarray of length exactly $k$.

A contiguous subarray is a consecutive segment of the original array — elements maintain their original order with no gaps between them.

If $k$ exceeds the array length or $k \leq 0$, return $0$.

Examples
Input: [[2,1,5,1,3,2],3]
Output: 9
Hints

Maximum Sum Subarray of Size K

Given an integer array `nums` and an integer $k$, return the maximum sum obtainable from any contiguous subarray of length exactly $k$.