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

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

$
0
0

Charcoal, 17 bytes

WS≔⁺ωιωWS⟦I⌊Eι№ωκ

Try it online! Link is to verbose version of code. Takes input as two newline-separated lists of newline-terminated strings. Explanation:

WS≔⁺ωιω

Input and flatten the grid.

WS

For each word in the list...

⟦I⌊Eι№ωκ

... output the minimum count of all of its letters in the flattened string.

Save 6 bytes by using a more awkward input format:

IEη⌊Eι№⪫θωλ

Try it online! Link is to verbose version of code. Explanation:

η         Word listE          Map over wordsι      Current wordE       Map over letters№     Count ofλ Current letter inθ   Grid⪫    Joined withω  Empty string⌊        Take the minimuimI           Cast to string            Implicitly print

Viewing all articles
Browse latest Browse all 20

Trending Articles



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