You are given an undirected graph. Your task is to determine whether the graph contains an odd-length cycle or an even-length cycle.
Return "Odd" if an odd-length cycle exists; otherwise, return "Even".
Input: V = 3, edges = [[0,1],[1,2],[2,0]]
Output: "Odd"
Explanation: The graph contains a cycle of length 3, which is odd.
Input: V = 4, edges = [[0,1],[1,2],[2,3],[3,0]]
Output: "Even"
Explanation: The graph contains a cycle of length 4, which is even.
Input: V = 2, edges = [[0,1]]
Output: "Even"
Explanation: The graph contains no odd-length cycle.
Sign in to write, run, and submit your solution against the full test suite.