Introduction
Logic gates! Everyone knows them, everyone loves them (unless you're starting to learn them). Take two booleans, compare them, get a single boolean in return. AND
, NAND
, OR
, NOR
, XOR
, XNOR
. Fun! But, what if you only had the inputs and output, but not the operator?
Challenge
Given a three digit number, xyz
, where x
and y
are inputs to the unknown gate(s) and z
is the output, list all the possible gates. The output order doesn't matter but it must be all caps and separated by a space. This is code-golf, so the shortest answer wins!
Example Inputs and Outputs
Inputs:
001
101
111
Outputs:
NAND NOR XNOR
NAND OR XOR
AND OR XNOR
10
or01
) \$\endgroup\$