You can check my solution. I have provided the link to question and my solution.
I don’t understand the part where in case of no relation, the one entered 1st should come before.
What should be the answer in this test case and can you explain how?
5
a
b
c
d
e
3
d a
c a
e b
Question:
https://online.codingblocks.com/app/player/65729/content/154766/5091/code-challenge
Solution: