Hi,
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:
three 3s
two 2s
two 3s
three 2s
four 1s
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:
WHILE
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.