Domanda di colloquio di Two Sigma

Two intermediate level C++ programming problems.