I need to define a loop / sequence in a string and return the first occurrence. How should I do it?
Example:
2 0 5 3 1 5 3 1 5 3 1
The first sequence will be 5 3 1.
No rules. The sequence can be half the length of the string, for example
5 3123 1231 231 31 231 41 452 3453 21 312312 5 3123 1231 231 31 231 41 452 3453 21 312312
Sequence 5 3123 1231 231 31 231 41 452 3453 21 312312
source
share