3 ms·
I see what you mean, but it just boils down to how you interpret the problem. Specifically, if you focus on the actual forwarding paths instead of the contact l
by sjroot 8y ago
I see what you mean, but it just boils down to how you interpret the problem. Specifically, if you focus on the actual forwarding paths instead of the contact lists, the tree structure that enables the linear solution becomes more clear.
As I’m guessing was intended, this problem is particularly well-suited for engineering interviews because you can start with an easy example (the DAG one could derive in this specific interview) then ask the applicant how the solution would change given the additional constraints you’ve described.
- pmiller2 8y agoThat’s simply not correct. Do an example. What graph do you draw? That’s the underlying graph that has to be acyclic. Where is this supposed tree structure coming from? Try a dense graph, like with n=5, and every actor having at least 3 contacts.