AGDATA Interview Question

You're given an easy logical problem to code.