Given a target word and one or more candidate words, your task is to find the candidates that are anagrams of the target.
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"
.
The target word and candidate words are made up 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 words you need to find should be taken from the candidate words, using the same letter case.
Given the target "stone"
and the candidate words "stone"
, "tones"
, "banana"
, "tons"
, "notes"
, and "Seton"
, the anagram words you need to find are "tones"
, "notes"
, and "Seton"
.