# [J], <sup><s>39</s></sup> 37 bytes [:;(_5<\'NAND NOR XNOR')}.~&.>*,+.,~: [Try it online!][TIO-k9jalxfo] [J]: http://jsoftware.com/ [TIO-k9jalxfo]: https://tio.run/##y/qvpKeepmBrpaCuoKNgoGAFxLp6Cs5BPm7/o62sNeJNbWLU/Rz9XBT8/IMUIoCEumatXp2anp2WjraeTp3Vf00urtTkjHygvjQFAwTTEMI0RIiCmIb/AQ "J – Try It Online" <sup>-2 bytes thanks to @Jonah.</sup> A solution that pretty much works like [Surculose Sputum's Python 3 answer](https://codegolf.stackexchange.com/a/203983/78410). ### How it works NB. The three segments in the new version _5<\'NAND NOR XNOR' 'NAND NOR XNOR' NB. a length-13 string _5<\ NB. enclose non-overlapping length-5 chunks (which works because the three N's to filter appear at indexes 0, 5, 10) NB. Previous version [:;('NAND ';'NOR X';'NOR')}.~&.>*,+.,~: NB. Input: two bits as left/right args *,+.,~: NB. evaluate AND, OR, XOR ('NAND ';'NOR X';'NOR') NB. corresponding three segments &.> NB. pair up both sides unboxed and }.~ NB. drop the first char from left if right is 1 [:; NB. Remove boxing and concatenate into a single vector