Walmart Global Tech interview question

Two sum question was asked with modifications