Can it be done with 2 pointer?

Question Link : Programming tutorials, Coding problems, and Practice questions

I am wondering if this question can be done using 2 pointer method . If so , can somebody share the code please ?