Samsung Electronics Interview Question

Print the loop nodes in a directed cyclic graph?