-
-
Notifications
You must be signed in to change notification settings - Fork 101
207. Course Schedule.cpp #76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for raising the PR, the owner will be review it soon' keep patience, keep contributing>>>!!! make sure you have star ⭐ the repo
|
hello... @harshitap1305 Star the repo ⭐Happy HAcktober... keep contributing... |
Removed problem statement and example comments from the Course Schedule file.
|
@SjxSubham please check now! |
Approach
This is a cycle detection in a directed graph problem.We use DFS with two arrays:
If during DFS we encounter a node that is already in the current path (pathVisit),
it means we found a cycle → return false.
Intuition
Solution in Code