11.03.2012, 13:55
Hello, I need some help with the detection of sequences of numbers.
In my script I have 7 numbers. Now, I need to find a way to make the script understand if there are atleast 5 of those 7 numbers that are in sequence.
For example, if the numbers are:
5 9 7 5 3 6 5, no sequence found.
4 9 3 6 2 5 11, found a sequence of atleast 5 numbers with maximum value of 6.
Thank you.
ps: if it can be useful, the numbers will range only from 2 to 14.
In my script I have 7 numbers. Now, I need to find a way to make the script understand if there are atleast 5 of those 7 numbers that are in sequence.
For example, if the numbers are:
5 9 7 5 3 6 5, no sequence found.
4 9 3 6 2 5 11, found a sequence of atleast 5 numbers with maximum value of 6.
Thank you.
ps: if it can be useful, the numbers will range only from 2 to 14.