AT&T interview question

Email asking to solve C++ problem