Attached are my solutions.
I took 2 different approaches:
Managed to do a small 5 tool solution.
I don't agree with the provided solution as all one purchase userID's appear in Merchant2 and with blank Marchant1. In my oppinion it should be opposite in accordance with Input data.