Arista Networks interview question

Two sum variation in python