Find the initial source and final destination accounts in a chain of transfers.
Unlock detailed company stats for this questionUpgrade
Amazon receives transfer notifications whenever money moves between accounts. Transfers form a chain, for example A -> B -> C -> D. Input is given as pairs [A, B], meaning money moved from A to B. Find the initial source account and the final destination account.
Example: numberOfTransfers = 3, transferList = [(222, 111), (111, 333), (444, 222)] gives start = 444 and end = 333, because 444 -> 222 -> 111 -> 333.
Community answers
No answers contributed by the community yet.


