words←⊃⎕nget 'wordlist.txt' 1 ⍝ read lines
tenK←'^........k.$' ⎕S '&' ⊢ words ⍝ regex filter
↑tenK/⍨{∧/1='abc'(+/∘.∊)⍵}¨tenK ⍝ count abc and filter
Dyalog APL, but it's still kinda ... heavy. words←⊃⎕nget 'wordlist.txt' 1 ⍝ read lines
tenK←'^........k.$' ⎕S '&' ⊢ words ⍝ regex filter
↑tenK/⍨{∧/1='abc'(+/∘.∊)⍵}¨tenK ⍝ count abc and filter
Dyalog APL, but it's still kinda ... heavy.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.