Given a directed graph with V vertices (0 to V-1) and E edges, detect if the graph contains a cycle.
Example 1:
Input: V=4, edges=[[0,1],[1,2],[2,0],[2,3]] Output: true
Example 2:
Input: V=4, edges=[[0,1],[1,2],[2,3]] Output: false
Constraints:
- 1 <= V <= 10^4
- 0 <= E <= 10^5