My question is more philosophical in nature.
When I first started attempting to solve this problem, I kept trying to remove the sub-arrays in question from the array. The solution I landed on (and the solution provided in the Get Hints section) involved just creating a new array that contained all the subarrays except the ones in question.
It seems inefficient, on principle, to create a new array when you could just modify an existing array.
Could anyone shed any light on why FCC doesn’t include a potential solution (in the Get Hints section) for just modifying the existing array? Is it because we hadn’t learned
delete yet (that comes a few lessons later)?
Thanks in advance!