AGDATA interview question

You're given an easy logical problem to code.