Fixed Sliding Window - Two Pointers / Sliding Window

https://algo.monster/problems/target_subarray_sum_fixed

How about if we just slide window from left to right and compare sum. Instead of popping out left and adding right to window sum .
‘’’
def target_subarray_sum_fixed(nums: List[int], k: int) → int:
if k > len(nums):
return 0
if k == len(nums):
return sum(nums)
current_sum = 0

for i in range(len(nums)):
    if i+ k < len(nums):
        subarry = nums[i: i + k]
        if sum(subarry) > current_sum:
            current_sum = sum(subarry)

return current_sum

‘’’