PayPal Interview Question

Given the data set, how would you get the desired output?