An algorithm is a sequence of steps to be followed to accomplish a certain task. Often used in computer programming, they can become interesting puzzles because even though there can be many ways to accomplish something, one may be better than another.

Construct a three input XOR gate using only one inverter and as many AND and OR gates as necessary. Try to minimize the total number of gates used in the logic circuit.

A three input XOR will act as a parity gate. It will output true when an odd number of inputs are true and return false when an even number of inputs are true.