An interviewer recently asked me this question: given three boolean variables, a, b, and c, return true if at least two out of the three are true.
My solution follow
In Clojure:
(defn at-least [n & bools] (>= (count (filter true? bools)) n)
Usage:
(at-least 2 true false true)