PharmEasy interview question

Two sum problem and its optimizations