Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add tests and refactor code smells for algorithms#63

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
nientbfx07802 wants to merge3 commits intorampatra:master
base:master
Choose a base branch
Loading
fromnientbfx07802:master

Conversation

@nientbfx07802
Copy link

Summary

This PR adds comprehensive unit tests and refactors code smells across multiple algorithm implementations.

Changes

  • New Tests: Added test suites for BuySellStocks, ClosestBinarySearchTreeValue, RansomNote, and ShortestWordDistanceIII
  • Refactoring: Improved code quality in ShortestWordDistanceIII by extracting a boolean flag to reduce complexity and enhance readability

Details

Tests Added:

  • BuySellStocks: 5 test cases covering edge cases and profit calculations
  • ClosestBinarySearchTreeValue: 6 test cases for tree traversal and value proximity
  • RansomNote: 6 test cases for character availability validation
  • ShortestWordDistanceIII: 6 test cases for word distance calculations

Code Refactoring:

  • Simplified ShortestWordDistanceIII logic by introducingisSameWord boolean to reduce nested conditions
  • Improved code readability with clearer comments

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

@nientbfx07802

[8]ページ先頭

©2009-2025 Movatter.jp