I had a google phone screen Round 2. They asked these questions:
O(n) O(nnc) - c for checking if i and j element are related.
Please let me know how do you guys solve this?
No luck this time, will prepare better for next.