I am curious to find out a function to check if a given list is periodic or not and return the periodic elements. lists are not loaded rather their elements are generated and added on the fly, if this note will make the algorithm easier anyhow.
For example, if the input to the function is [1,2,1,2,1,2,1,2]
, the output shall be (1,2).
I am looking for some tips and hints on the easier methods to achieve this.
Thanks in advance,