11-18-2016 01:50 PM
Let's say I have 36 elements in my array and I would like to delete elements 10,11 and also 10+i*12 and 11+i*12
I mean for example 10,11,22,23, 34 and 35 when i starts from 0 to 3
What is the simplest way to implement this
11-18-2016 02:04 PM
You'll need a For Loop. You'll need a shift register to maintain the array between iterations as you proceed to delete each element.
I'd recommend deleting the last elements first because if you delete an earlier element, all of the index values of the later elements will shift forward by 1.
11-18-2016 02:16 PM
This code actually conditionally (re)builds the resulting array rather than deleting elements, which provides the same effect.