Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bool check(node S, bool isSecond = false) {
- S.isVisited = true
- for <S, P> in E {
- if P.isVisited && isSecond {
- return true
- }
- if check(P, !isSecond) {
- return true
- }
- }
- return isSecond
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement