Amazon Interview Question

Duplicate cycles in a graph