Hello Everyone ...
Today I was solving this problem ... Problem statement : You are given a directed weighted graph, and your task is to find out if it contains a negative cycle, and also give an example of such a cycle.
I am aware of solving this problem using Bellman Ford's Algorithm , But I am trying another approach which is giving me WA in 1 Test Case (total 13 is there) .
So , Can anyone point out whether this approach is correct or not ... and If it is correct then suggest me some modification otherwise give some counter examples where this code might fail.
code
Thanks in advance :) and sorry for my bad english.