Bigram checker
A bigram is a sequence of two letters. Common bigrams in English include st
and tr
. Write a function to check if all bigrams in a collection are present in the words in a string.
Examples
(all-present? ["st" "tr"] "street") ;=> true
(all-present? ["ea" "ng" "kt"] "eating at a restaurant") ;=> false
(all-present? [] "hello!") ;=> true
Thanks to this site for the problem idea, where it is rated Hard in Ruby. The problem has been modified.
Please submit your solutions as comments on this gist.
To subscribe: https://purelyfunctional.tv/newsletter/
I'm relatively new to Clojure and I really enjoy seeing all the different ways to solve a problem.
This was my take on it: