---
title: "Discussion on \"GeeksForGeeks: Max Sum Subarray of size K\" | Hashnode"
description: "Discussion on \"GeeksForGeeks: Max Sum Subarray of size K\". Problem:\nhttps://www.geeksforgeeks.org/problems/max-sum-subarray-of-size-k5313/1\nCode:\nclass Solution:\n    def maxSubarraySum(self, arr, k):\n        # window_size = k\n        window_sum=sum(arr[:k])\n        max_sum=window_sum #not zero as sums can be..."
url: "https://hashnode.com/posts/geeksforgeeks-max-sum-subarray-of-size-k/6929df57fd487b2debc60be6"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [GeeksForGeeks: Max Sum Subarray of size K](https://is-power-of-two.hashnode.dev/geeksforgeeks-max-sum-subarray-of-size-k?utm_source=hashnode&utm_medium=feed)

Problem: https://www.geeksforgeeks.org/problems/max-sum-subarray-of-size-k5313/1 Code: class Solution: def maxSubarraySum(self, arr, k): # window\_size = k window\_sum=sum(arr\[:k\]) max\_sum=window\_sum #not zero as sums can be...

Nov 28, 2025 · 1 min read · is-power-of-two.hashnode.dev  
Read the article

-   [#geeksforgeeks](https://hashnode.com/tag/geeksforgeeks)
-   [#leetcode](https://hashnode.com/tag/leetcode)
-   [#python](https://hashnode.com/tag/python)

## Written by

[Shahwar Alam Naqvi](https://hashnode.com/@shahwar01)

@shahwar01

  
[View profile](https://hashnode.com/@shahwar01)

Coder

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
