Introduction
According to Rand Al'Thor's post in the Puzzling SE, a close-knit word is any word that contains three alphabetically consecutive letters (in any order).
Words like education, foghorn and cabaret are all considered close-knit words whereas words like learning, klaxon and perform are not close-knit words.
Challenge
The challenge is to code-golf a program capable of taking a single word as input (assumed lower case, for all intents and purposes) and to return output that (if available) lists all consecutive letter sets (also in lower case) if it is a close-knit word, and empty output if it is not a close-knit word.
Examples
Input: education
Output: cde
Input: foghorn
Output: fgh
Input: cabaret
Output: abc
Input: hijacking
Output: ghi, hij, ijk
Input: pneumonia
Output: mno, nop
Input: klaxon
Output: <<no output>>
Input: perform
Output: <<no output>>
Input: learning
Output: <<no output>>
Rules
- Whereas input is to be assumed to be a single lower-case word and output must be lower-case, the nature of the output will vary according to the choice of your coding language. Please select a form of output that will best suit the nature of the challenge, whether it be STDOUT, file output, array, etc.
- Because this is code-golf, it will be a case of lowest number of bytes being the clear winner.
- No silly loopholes.
- I will not accept answers that have the consecutive letters in non-alphabetical order... So
cab
will not be deemed a suitable output forcabaret
, for example. - Special note, while the "triplets" don't necessarily have to be in alphabetical order, but the characters within the triplets must be... so in the case of the word "performance", for example, the output
mno,nop
will be accepted, as willnop,mno
. In the case of the word "hijacking", there are six ways that the triplets ofghi
,hij
andijk
could be arranged in a list, and all six permutations are acceptable as output.
Other than that, on your marks, get set, golf!
!
And with another word, as the current one gives the same result :-) \$\endgroup\$pneumonia
can be[('m','n','o'),('n','o','p')])
? \$\endgroup\$