Everpure Interview Question

one of the tasks was solving two pointers problem