This problem took me a lot of time (even after reading the hints!). If you're stuck, consider not making the same mistakes I did.
#1) The output is supposed to be in INCREASING order of node numbers and NOT in any order of traversal.
#2) A list of outputs/results they (testers) aren't really interested in:
Let c1,c2,c3 and so on be nodes actually forming a -ve cycle and o1,o2,o3 and so on be nodes NOT within that -ve cycle, BUT they can reach that cycle. Please look at the test case.
1 //the only test case
6 6//nodes and edges
0 1 1
1 2 2