Negative values doubt

Hi,
Please explain why we are not changing negative values if cycle is not possible?

hello @vatsal50

when we have found a negative number(while looking for positive cyle) then we have come to conclusion that that the current cycle that we are extending does not exist, so we should mark all elements that we have visited so far with 0(all psitive number,becuase they cant be part of any cycle) ,but excluding this negative number.
becuase this negative number can itself be a part of negative cycle (cyle with all elements negative).

in the video also bhaiya has given example for both the cases, once rewatch the video

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.