SPANCLAS - Editorial

This problem is inspired by Neural Nets in machine learning. Nowadays, everyone is talking about deep learning and Artificial Neural Nets (ANNs). This problem used a very trivialized definition of Neural Nets.

The solution idea is to recognize that only the parity of the input matters. So, we check for a parity 0 and parity 1 input and check their output via the neural nets. Finally, after this, finding the number of even and odd outputs is just a simple computation.