Given a circular array of non-zero integers, determine whether the array contains a loop that moves in a single direction and has length greater than 1. This is a cycle-detection problem on an implicit directed graph.
nums = circular array
true if a valid cycle exists, otherwise false
Example 1:
Input:
nums = [2,-1,1,2,2]
Output:
true
Explanation:
A cycle exists with consistent direction.
Example 2:
Input:
nums = [-1,2]
Output:
false
Explanation:
Any loop would be invalid or of length 1.