Infosys Interview Question

How to solve 3sum leetcode