can someone tell me what logic i can use to solve this problem?..
Detect Negative cycle in graph.
If found. Print YES
Use this for reference.
You can use Floyd-Warshall to find distances between all the edges and then for each pair check if Dist(u, v) + Dist(v, u) < 0.
My solution link: