Skip to content

Add approaches (Dig Deeper) for isogram - #1022

Merged
rabestro merged 2 commits into
mainfrom
isogram-approaches
Nov 22, 2026
Merged

rabestro merged 2 commits into
mainfrom
isogram-approaches

Conversation

@rabestro

Copy link
Copy Markdown
Member

Closes #984

isogram's "Dig Deeper" tab is empty on the Scala track. This adds an introduction and four approaches:

Slug Idea
distinct letters.distinct.length == letters.length (the current example)
counting groupMapReduce(identity)(_ => 1)(_ + _).values.forall(_ == 1)
recursion-set a tail-recursive walk with a Set[Char] that stops at the first repeated letter
bit-field foldLeft that sets a bit per letter, then Integer.bitCount(seen) == letters.length

The issue asks to refresh the exercise first. That is already done on main: the suite is generated and the example is Scala 3, so this PR only adds .approaches/.

Two things differ from the issue:

  • bit-field has no early exit, unlike the Python and JavaScript bit fields. It compares bitCount with the number of letters, so it does not repeat recursion-set with an Int in place of the Set.
  • bit-field has a caution block: it handles only a to z, so a word that repeats a letter such as é would be taken for an isogram. The other three use isLetter.

Checks

  • Every full solution in the markdown passes isogram's test suite with all 14 tests enabled.
  • The code is unchanged by scalafmt 3.8.2 with the track's .scalafmt.conf.
  • The Scaladoc links point at https://www.scala-lang.org/api/current/..., and every external link resolves.
  • bin/configlet lint passes.

🤖 Generated with Claude Code

Four approaches: filter with distinct, counting with groupMapReduce,
tail recursion with a Set, and a bit field with bitCount.

Closes #984

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@rabestro rabestro self-assigned this Nov 14, 2026
@github-actions

Copy link
Copy Markdown

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
rabestro marked this pull request as draft November 14, 2026 21:30
@rabestro
rabestro marked this pull request as ready for review November 22, 2026 16:17
@rabestro
rabestro requested review from a team, IsaacG and glennj November 22, 2026 16:17
@rabestro
rabestro merged commit 43ab686 into main Nov 22, 2026
8 checks passed
@rabestro
rabestro deleted the isogram-approaches branch November 22, 2026 16:56
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.

Add approaches (Dig Deeper) for isogram

2 participants