Skip to content

fix: keep pangram checks ASCII-scoped#14687

Open
Sean-Kenneth-Doherty wants to merge 1 commit into
TheAlgorithms:masterfrom
Sean-Kenneth-Doherty:codex/fix-pangram-ascii-filter
Open

fix: keep pangram checks ASCII-scoped#14687
Sean-Kenneth-Doherty wants to merge 1 commit into
TheAlgorithms:masterfrom
Sean-Kenneth-Doherty:codex/fix-pangram-ascii-filter

Conversation

@Sean-Kenneth-Doherty
Copy link
Copy Markdown

Summary

  • Keep all pangram implementations scoped to English ASCII letters.
  • Prevent is_pangram_faster() from raising IndexError on lowercase non-ASCII letters.
  • Prevent is_pangram_fastest() from counting non-English letters toward the 26-letter pangram total.

Reproduction

Before this change, is_pangram_faster("abcdefghijklmnopqrstuvwxy\u00e9") raised IndexError, while is_pangram_fastest(...) returned True even though z is missing.

Validation

  • python -m doctest -v strings/is_pangram.py
  • uvx --from pytest pytest --doctest-modules strings/is_pangram.py
  • uvx ruff check strings/is_pangram.py

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.

1 participant