Skip to content

fix: binary_count_trailing_zeros#14574

Open
anup-sys wants to merge 3 commits intoTheAlgorithms:masterfrom
anup-sys:binary_count_trailing_zeros
Open

fix: binary_count_trailing_zeros#14574
anup-sys wants to merge 3 commits intoTheAlgorithms:masterfrom
anup-sys:binary_count_trailing_zeros

Conversation

@anup-sys
Copy link
Copy Markdown

…14479

Description

This PR fixes input validation in binary_count_trailing_zeros.

  • Ensures type checking is performed before comparisons
  • Prevents unintended TypeError for non-integer inputs (e.g., strings)
  • Maintains existing behavior for a == 0 (returns 0 by convention)

Type of change

  • Fix a bug or typo in an existing algorithm

Checklist

  • I have read the contributing guidelines
  • This PR is my own work
  • This PR only changes one algorithm file
  • All functions include doctests that pass

@algorithms-keeper algorithms-keeper Bot added enhancement This PR modified some existing files awaiting reviews This PR is ready to be reviewed labels Apr 23, 2026
@algorithms-keeper algorithms-keeper Bot added the tests are failing Do not merge until tests pass label Apr 23, 2026
@anup-sys anup-sys changed the title fix: input validation in binary_count_trailing_zeros fix: binary_count_trailing_zeros Apr 23, 2026
@algorithms-keeper algorithms-keeper Bot removed the tests are failing Do not merge until tests pass label Apr 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting reviews This PR is ready to be reviewed enhancement This PR modified some existing files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant