Skip to content

Conversation

@VeeruYadav45
Copy link

This PR adds an efficient subarray sum implementation using the sliding window approach, improving performance from O(n²) to O(n).

Changes

1-Implemented subarray sum calculation using a single-pass sliding window algorithm.
2-Optimized for better time complexity (O(n)) and lower memory usage.
3-Added relevant test cases to validate correctness and performance.
4-Updated documentation/comments for better readability.

Benefits

1-Significantly faster for large input arrays.
2-Cleaner and more maintainable code structure.
3-Avoids unnecessary nested loops from the previous approach.

@Ghost4474 Ghost4474 force-pushed the main branch 28 times, most recently from 77f9bbb to 47e3929 Compare October 10, 2025 00:14
@Ghost4474 Ghost4474 force-pushed the main branch 30 times, most recently from 9fb4c84 to 46675f2 Compare November 9, 2025 02:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants