Given a sequence, write a program to detect cycles within it.
Your program should accept as its first argument a path to a filename containing a sequence of numbers (space delimited). The file can have multiple such lines. E.g
Print to stdout the first cycle you find in each sequence. Ensure that there are no trailing empty spaces on each line you print. E.g.
The cycle detection problem is explained more widely on wiki
The elements of the sequence are integers in range [0, 99]
The length of the sequence is in range [0, 50]