Infosys interview question

How to solve 3sum leetcode