Skip to content

refactor: optimize ValidParentheses methods and add parameterized tests #6352

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 8, 2025

Conversation

alxkm
Copy link
Contributor

@alxkm alxkm commented Jul 7, 2025

  • Simplified stack-based logic for better readability and efficiency
  • Combined similar validation approaches into clearer methods
  • Added parameterized tests covering diverse valid and invalid cases
  • Improved error handling for unexpected characters with informative exceptions
  • I have read CONTRIBUTING.md.
  • This pull request is all my own work -- I have not plagiarized it.
  • All filenames are in PascalCase.
  • All functions and variable names follow Java naming conventions.
  • All new algorithms have a URL in their comments that points to Wikipedia or other similar explanations.
  • All new code is formatted with clang-format -i --style=file path/to/your/file.java

@codecov-commenter
Copy link

codecov-commenter commented Jul 7, 2025

Codecov Report

Attention: Patch coverage is 60.00000% with 4 lines in your changes missing coverage. Please review.

Project coverage is 74.62%. Comparing base (fa2ca9d) to head (2588cdc).

Files with missing lines Patch % Lines
...va/com/thealgorithms/strings/ValidParentheses.java 60.00% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #6352      +/-   ##
============================================
+ Coverage     74.60%   74.62%   +0.01%     
+ Complexity     5453     5449       -4     
============================================
  Files           682      682              
  Lines         19030    19017      -13     
  Branches       3683     3677       -6     
============================================
- Hits          14198    14191       -7     
+ Misses         4270     4269       -1     
+ Partials        562      557       -5     

☔ 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.

@siriak siriak merged commit 6c30495 into TheAlgorithms:master Jul 8, 2025
6 of 7 checks passed
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.

3 participants