Find all the Anagrams!
05AB1E, 3 bytes
œÙ¦
A function that leaves the stack with a list of the anagrams on top (and as its only item). As a full program prints a representation of that list.
Try it online!
How?
- push input
œ - pop and push a list of all permutations (input appears at the head)
Ù - pop and push a list of unique items (sorted by first appearance)
¦ - pop and push a dequeued list (removes the occurrence of the input)
- As a full program: implicit print of the top of the stack
Ruby, 45 bytes
->x{(x.chars.permutation.map(&:join)-[x])|[]}
Try it online!
Despite having a built-in, the word "permutation" is really long :(
pyth, 8 4
-{.p
Online test.
.pQ # all permutations of the (implicit) input string
{ # de-duplicate
- Q # subtract (implicit) input