IndiaMART Interview Question

Two sum and four sum problem