Can you reach the last node of a directed graph by jumping along edges?
Constraints
Example
>>> can_reach(5, [[0,1],[1,2],[2,3],[3,4]]) True >>> can_reach(5, [[0,1],[2,3],[3,4]]) False >>> can_reach(3, [[0,2]]) True >>> can_reach(1, []) True
Recent Submissions
No submissions yet — hit Run Tests to try!
Hints