def max_sum_subarray(arr, k):
    """Find maximum sum of any contiguous subarray of size k.

    Time:  O(n)
    Space: O(1)
    """
    max_sum = win_sum = 0
    win_start = 0
    for win_end in range(len(arr)):
        win_sum += arr[win_end]
        if win_end >= k - 1:
            max_sum = max(max_sum, win_sum)
            win_sum -= arr[win_start]
            win_start += 1
    return max_sum