I\'m building a word search game and am looking for an "R" way to do the last line of this reprex, which is trivial for 2 words, but I want it to handle n<