Sir, i think this problem is talking about Topological Sorting.
My Solution–https://ide.codingblocks.com/s/75106
Problem Link–https://hack.codingblocks.com/contests/c/668/781
Where am i going wrong?
Vivek And Party Problem
for the tc
5
A
B
C
D
E
5
C A
D A
B D
E B
E C
your code outputs E C B D A
correct answer E B C D A
because B comes before C in the input and there is no relation between B and C.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.