Quantcast
Channel: Words with Easy Letters in a Word Search - Code Golf Stack Exchange
Viewing all articles
Browse latest Browse all 20

Answer by coltim for Words with Easy Letters in a Word Search

$
0
0

K (ngn/k), 14 bytes

{&/'(#'=,/x)y}

Try it online!

Takes the grid of letters as x (the first arg), and the list of words as y (the second arg).

  • (#'=,/x)
    • ,/x flatten the grid of letters into a single string
    • #'= build a dictionary mapping the unique letters to the number of times they occur
  • (...)y index into this with the list of words
  • &/' get the number of times the least common letter in each word appears in the grid (and implicitly return)

Viewing all articles
Browse latest Browse all 20

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>