Java
Java copied to clipboard
Add Longest Subarray with Sum Less Than or Equal to K algorithm and t…
…ests
- [x] I have read CONTRIBUTING.md.
- [x] This pull request is all my own work -- I have not plagiarized it.
- [x] All filenames are in PascalCase.
- [x] All functions and variable names follow Java naming conventions.
- [x] All new algorithms have a URL in their comments that points to Wikipedia or other similar explanations.
- [x] All new code is formatted with
clang-format -i --style=file path/to/your/file.java
Codecov Report
Attention: Patch coverage is 90.00000% with 1 line in your changes missing coverage. Please review.
Project coverage is 72.38%. Comparing base (
a163816) to head (ce2c76c).
| Files with missing lines | Patch % | Lines |
|---|---|---|
| ...ngwindow/LongestSubarrayWithSumLessOrEqualToK.java | 90.00% | 0 Missing and 1 partial :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## master #6039 +/- ##
============================================
+ Coverage 72.37% 72.38% +0.01%
- Complexity 4981 4984 +3
============================================
Files 652 653 +1
Lines 17569 17579 +10
Branches 3385 3387 +2
============================================
+ Hits 12716 12725 +9
Misses 4373 4373
- Partials 480 481 +1
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
This pull request introduces the LongestSubarrayWithSumLessOrEqualToK class, which implements an algorithm to find the length of the longest subarray whose sum is less than or equal to a given value k. I have added junits and its working fine , you may check and merge.