Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Somewhat tuned Rye solution #6

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update p98.rye - indentation
  • Loading branch information
refaktor authored Jan 21, 2025
commit 1ddb9a896dbf7c7f701250d5d40e922c48e91ab1
8 changes: 4 additions & 4 deletions src/p98.rye
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ find-anagrams: fn { l } {
|map { .second } |sort |partition { , } |filter { .length? > 1 } |map { .first } :anagrams
info .filter { .second .contains* anagrams }
|map { .first }
|group { .sort }
|values .to-block
|group { .sort }
|values .to-block
|map { .permute-pairs }
|unpack
}
Expand All @@ -25,8 +25,8 @@ find-anagrams: fn { l } {
get-transformation: fn { pair } {
.second :b , .first :a
|split "" |vals\with {
.map { .position?* a } |join ,
.map { .position?* b } |join
.map { .position?* a } |join ,
.map { .position?* b } |join
} |join\with "-"
}

Expand Down