JPMorganChase Interview Question

They have asked to write two pointer technique program.