Skip to content

Conversation

@nihalsingh373
Copy link

Added a new algorithm SmallestSubarrayWithSum in the slidingwindow package.
It finds the minimum length subarray with sum ≥ target using the sliding window technique.
Runs in O(n) time and O(1) space.
Handles edge cases like empty arrays and single-element subarrays.
Implements clean, modular, and documented code per Checkstyle rules.
Follows TheAlgorithms Java contribution standards.
Enhances the collection of sliding window algorithms.
Useful for interview prep and competitive programming.
Validated locally with mvn checkstyle:check — no style errors.

@codecov-commenter
Copy link

codecov-commenter commented Oct 29, 2025

Codecov Report

❌ Patch coverage is 77.77778% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.35%. Comparing base (bb6385e) to head (2d7a451).

Files with missing lines Patch % Lines
...orithms/slidingwindow/SmallestSubarrayWithSum.java 77.77% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #6986      +/-   ##
============================================
- Coverage     78.35%   78.35%   -0.01%     
- Complexity     6615     6619       +4     
============================================
  Files           746      747       +1     
  Lines         22015    22024       +9     
  Branches       4320     4323       +3     
============================================
+ Hits          17249    17256       +7     
- Misses         4078     4079       +1     
- Partials        688      689       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@nihalsingh373
Copy link
Author

Hi maintainers 👋

All CI and Checkstyle checks have successfully passed ✅
This PR adds the SmallestSubarrayWithSum algorithm under the slidingwindow package, following the project’s coding and documentation guidelines.

Kindly review when convenient — I’d appreciate your feedback or approval for merge 🙌

Thanks for maintaining this amazing project! 💡

@nihalsingh373 nihalsingh373 closed this by deleting the head repository Oct 29, 2025
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