From a974d013d1e5df1161440dcac2c629cccea4affc Mon Sep 17 00:00:00 2001 From: Bart Massey Date: Wed, 19 Jan 2022 11:27:52 -0800 Subject: [PATCH 1/3] updated description of anagrams --- exercises/anagram/description.md | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/exercises/anagram/description.md b/exercises/anagram/description.md index cdc586fe30..48954a38ed 100644 --- a/exercises/anagram/description.md +++ b/exercises/anagram/description.md @@ -1,8 +1,21 @@ # Description -An anagram is a rearrangement of letters to form a new word. -Given a word and a list of candidates, select the sublist of anagrams of the given word. +An anagram is a rearrangement of letters to form a new word: +for example `"owns"` is an anagram of `"snow"`. A word is +not its own anagram: for example, `"stop"` is not an anagram +of `"stop"`. -Given `"listen"` and a list of candidates like `"enlists" "google" -"inlets" "banana"` the program should return a list containing -`"inlets"`. +Given a target word and a list of candidate words, this +exercise requests the anagram list: the sublist of the +candidates that are anagrams of the target. + +The target and candidates are words in ASCII alphabetic +characters (`A`-`Z` and `a`-`z`). Lowercase and uppercase +characters are equivalent: for example, `"PoTS"` is an +anagram of `"sTOp"`. The candidate set is represented as an +unordered list. The anagram set must be the sublist of all +anagrams in the candidate set (in the same order). + +Given the target `"stone"` and candidates `"stone"`, +`"tones"`, `"banana"`, `"tones"`, `"tons"`, `"notes"`, `"Seton"`, the +anagram list is `"tones"`, `"tones"`, `"notes"`, `"Seton"`. From 0f4aa5be8712678747525da8d5b881e5c015ded0 Mon Sep 17 00:00:00 2001 From: Bart Massey Date: Thu, 20 Jan 2022 09:37:53 -0800 Subject: [PATCH 2/3] changed anagram description to be one-sentence-per-line --- exercises/anagram/description.md | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/exercises/anagram/description.md b/exercises/anagram/description.md index 48954a38ed..1fb75fb518 100644 --- a/exercises/anagram/description.md +++ b/exercises/anagram/description.md @@ -1,21 +1,13 @@ # Description -An anagram is a rearrangement of letters to form a new word: -for example `"owns"` is an anagram of `"snow"`. A word is -not its own anagram: for example, `"stop"` is not an anagram -of `"stop"`. +An anagram is a rearrangement of letters to form a new word: for example `"owns"` is an anagram of `"snow"`. + A word is not its own anagram: for example, `"stop"` is not an anagram of `"stop"`. -Given a target word and a list of candidate words, this -exercise requests the anagram list: the sublist of the -candidates that are anagrams of the target. +Given a target word and a list of candidate words, this exercise requests the anagram list: the sublist of the candidates that are anagrams of the target. -The target and candidates are words in ASCII alphabetic -characters (`A`-`Z` and `a`-`z`). Lowercase and uppercase -characters are equivalent: for example, `"PoTS"` is an -anagram of `"sTOp"`. The candidate set is represented as an -unordered list. The anagram set must be the sublist of all -anagrams in the candidate set (in the same order). +The target and candidates are words in ASCII alphabetic characters (`A`-`Z` and `a`-`z`). +Lowercase and uppercase characters are equivalent: for example, `"PoTS"` is an anagram of `"sTOp"`. +The candidate set is represented as an unordered list. +The anagram set must be the sublist of all anagrams in the candidate set (in the same order). -Given the target `"stone"` and candidates `"stone"`, -`"tones"`, `"banana"`, `"tones"`, `"tons"`, `"notes"`, `"Seton"`, the -anagram list is `"tones"`, `"tones"`, `"notes"`, `"Seton"`. +Given the target `"stone"` and candidates `"stone"`, `"tones"`, `"banana"`, `"tones"`, `"tons"`, `"notes"`, `"Seton"`, the anagram list is `"tones"`, `"tones"`, `"notes"`, `"Seton"`. From 0c9f321ad4fd6465b010f04f6e8f3503251d8a36 Mon Sep 17 00:00:00 2001 From: Bart Massey Date: Tue, 25 Jan 2022 10:27:41 -0800 Subject: [PATCH 3/3] updated description of anagrams to use sets --- exercises/anagram/description.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/exercises/anagram/description.md b/exercises/anagram/description.md index 1fb75fb518..f686f5ea1b 100644 --- a/exercises/anagram/description.md +++ b/exercises/anagram/description.md @@ -1,13 +1,13 @@ # Description An anagram is a rearrangement of letters to form a new word: for example `"owns"` is an anagram of `"snow"`. - A word is not its own anagram: for example, `"stop"` is not an anagram of `"stop"`. +A word is not its own anagram: for example, `"stop"` is not an anagram of `"stop"`. -Given a target word and a list of candidate words, this exercise requests the anagram list: the sublist of the candidates that are anagrams of the target. +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. -The target and candidates are words in ASCII alphabetic characters (`A`-`Z` and `a`-`z`). -Lowercase and uppercase characters are equivalent: for example, `"PoTS"` is an anagram of `"sTOp"`. -The candidate set is represented as an unordered list. -The anagram set must be the sublist of all anagrams in the candidate set (in the same order). +The target and candidates are words of one or more ASCII alphabetic characters (`A`-`Z` and `a`-`z`). +Lowercase and uppercase characters are equivalent: for example, `"PoTS"` is an anagram of `"sTOp"`, but `StoP` is not an anagram of `sTOp`. +The anagram set is the subset of the candidate set that are anagrams of the target (in any order). +Words in the anagram set should have the same letter case as in the candidate set. -Given the target `"stone"` and candidates `"stone"`, `"tones"`, `"banana"`, `"tones"`, `"tons"`, `"notes"`, `"Seton"`, the anagram list is `"tones"`, `"tones"`, `"notes"`, `"Seton"`. +Given the target `"stone"` and candidates `"stone"`, `"tones"`, `"banana"`, `"tons"`, `"notes"`, `"Seton"`, the anagram set is `"tones"`, `"notes"`, `"Seton"`.