Hello!
I have a big array with one of two values (0 or 1) for each index.
The length of the array can get to 100k elements or more.
Given the big array as input I want the output to be constructed by subsets of consecutive 0's or 1's.
I am interested in the pair (start_index, end_index) for each subset.
Subsets should have a minimum length of 50 (this should be a parameter). So if there is a shorter subset of 1's, the script has to add more surplus 0's to reach the minimum length when creating the subsets.
Very important. I want the approximation of these subsets, meaning, I would want to not look at every consecutive value and use a jump smaller than the minimum length of the subsets so no 1's subsets are lost during the process.
Parameters should be :
step size = 1,2,3 ... 25 ... 50 ... 100 variable
and min_length = 50 ... 100 ... etc
I don't want to read every value from the indexes so I want also to print the length of the input array and a count of the used values in doing the approximation.
The stepsize can also go down in some cases for accurate index findings.
We can discuss more in private if you are interested in this easy project.