Repository navigation
Add approaches (Dig Deeper) for pangram - #1018
Merged
Merged
Conversation
Four approaches: Set with subsetOf, forall with contains, filter with distinct, and a bit field built with foldLeft. Closes #983 Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
Hello 👋 Thanks for your PR. This repo does not currently have dedicated maintainers. Our cross-track maintainers team will attempt to review and merge your PR, but it will likely take longer for your PR to be reviewed. If you enjoy contributing to Exercism and have a track-record of doing so successfully, you might like to become an Exercism maintainer for this track. Please feel free to ask any questions, or chat to us about anything to do with this PR or the reviewing process on the Exercism forum. (cc @exercism/cross-track-maintainers) |
rabestro
marked this pull request as draft
November 14, 2026 21:24
rabestro
marked this pull request as ready for review
November 22, 2026 16:07
IsaacG
approved these changes
Nov 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #983
pangram's "Dig Deeper" tab is empty on the Scala track. This adds an introduction and four approaches:
set-subsetalphabet.subsetOf(input.toLowerCase.toSet)(the current example)forall('a' to 'z').forall(lowercase.contains)distinct-countatoz, then.distinct.length == 26bit-fieldfoldLeftthat sets bitc - 'a', compared with(1 << 26) - 1The introduction compares them by readability and by how often the sentence is walked:
forallcan scan it up to 26 times, the bit field visits it once and allocates nothing.distinct-counthas a caution block that is not in the issue:isLetteris also true for letters such asé, so using it as the filter would take 25 letters plus anéfor a pangram.Checks
.scalafmt.conf.https://www.scala-lang.org/api/current/...and resolve.bin/configlet lintpasses.🤖 Generated with Claude Code