> tenK←'^........k.$' ⎕S '&' ⊢ words ⍝ regex filter
Is tenK←{(10=≢⍵)∧⍵[9]='k'}¨words better?
Feel that better matches the problem spec, although requires the each
Is tenK←{(10=≢⍵)∧⍵[9]='k'}¨words better?
Feel that better matches the problem spec, although requires the each
words←↑⊃⎕nget 'wordlist.txt' 1
tenK←words⌿⍨('k'=words[;9])∧(' '≠words[;10])∧(' '=words[;11])
tenK⌿⍨{∧/1='abc'(+/∘.∊)⍵}⍤1⊢tenK
Mix ↑ turns the nested wordlist into a 2D array by padding short strings out to the length of the longest using spaces, which I don't like but am (ab)using here to tell when the words end.