I have a sequence of numbers stored in an array as single numbers for each element. I'm trying to search for consecutive number of matches. Example:
1 2 3 3 3 2 2 3 3 2 2 2 1 1 1 1
The result would be:
Also, the sequence of numbers can have varying lengths.
I've tried using WHILE but to no avail as the condition to stop the WHILE loop doesn't seem to work:
array.at(index) NOT EQUAL TO 0 (action)
In the action, I increment index.
I'm trying to check for matches while not end of sequence taking 0 to be the end of the sequence. By the way, if the array element is empty,is it still a '0' or a NULL?
Any help rendered will be greatly appreciated.