Hi everyone!
I have a small question.
I have an array that looks something like this [0 0 2 2 2 2 2 0 0 0 2 2 2 2 2 2 2 0 0 0 0 2 2]
And I'd like to find those intervals of consectuve 2s that are longer than 3 elements. After that I find those interval, I want to cut the first elements untill they reach the length for 3 elements.
So my final array should be like this [0 0 0 0 2 2 2 0 0 0 0 0 0 0 2 2 2 0 0 0 0 2 2]
The first interval of 2s was made by 5 elements, now it's only 3 elements.
The second interval of 2s was made by 7 elements, now it's only 3.
The last one was made by 2 elements, it says the same.
Is it possible to do this?
Thank you very much and I hope you're having a nice day
Best Answer