Chef and Round Run Help

Question Link -
My Solution Link -

I am trying to do this question using Strongly Connected Components. Any idea on how to optimize code more for not getting TLE in last case ?

You can check your AC solution here: SAME SOLUTION AC

Check it out and you will get your mistake.

1 Like

Oh, Thanks. Never thought this can make code give TLE. Will keep this in mind now. Thanks :slight_smile:

1 Like