Revise factorizing implementation and test cases to cover multiple overlapping add/remove diff array index adjustments