Skip to content

Commit 11f079d

Browse files
Sync the anagram exercise's docs with the latest data.
1 parent 4659e27 commit 11f079d

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

exercises/practice/anagram/.docs/instructions.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Instructions
22

3-
An anagram is a rearrangement of letters to form a new word: for example `"owns"` is an anagram of `"snow"`.
4-
A word is not its own anagram: for example, `"stop"` is not an anagram of `"stop"`.
3+
Your task is to, given a target word and a set of candidate words, to find the subset of the candidates that are anagrams of the target.
54

6-
Given a target word and a set of candidate words, this exercise requests the anagram set: the subset of the candidates that are anagrams of the target.
5+
An anagram is a rearrangement of letters to form a new word: for example `"owns"` is an anagram of `"snow"`.
6+
A word is _not_ its own anagram: for example, `"stop"` is not an anagram of `"stop"`.
77

88
The target and candidates are words of one or more ASCII alphabetic characters (`A`-`Z` and `a`-`z`).
99
Lowercase and uppercase characters are equivalent: for example, `"PoTS"` is an anagram of `"sTOp"`, but `StoP` is not an anagram of `sTOp`.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Introduction
2+
3+
At a garage sale, you find a lovely vintage typewriter at a bargain price!
4+
Excitedly, you rush home, insert a sheet of paper, and start typing away.
5+
However, your excitement wanes when you examine the output: all words are garbled!
6+
For example, it prints "stop" instead of "post" and "least" instead of "stale."
7+
Carefully, you try again, but now it prints "spot" and "slate."
8+
After some experimentation, you find there is a random delay before each letter is printed, which messes up the order.
9+
You now understand why they sold it for so little money!
10+
11+
You realize this quirk allows you to generate anagrams, which are words formed by rearranging the letters of another word.
12+
Pleased with your finding, you spend the rest of the day generating hundreds of anagrams.

0 commit comments

Comments
 (0)