Sailthru Interview Question

Simple algorithm problem