This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // { Driver Code Starts | |
| #include<bits/stdc++.h> | |
| using namespace std; | |
| #define watch(x) cout << (#x) << " is " << (x) << "\n" | |
| #define watch2(x,y) cout <<(#x)<<" is "<<(x)<<" and "<<(#y)<<" is "<<(y)<<"\n" | |
| //-------------------------------------------------------------------------------------------------- | |
| // Detect cycle in Directed Graph | |
| // https://www.youtube.com/watch?v=1u2VLzBhJZU | |
| bool res=true; |