What if the arrays are (1, 2, 2, 3) and (1, 3, 5) and I want my map to run over (1, 2, 3, 1, 3, 5) ? Doesn't matter why ... what if that is the requirement?
My criteria for good software:
Does it work?
Can someone else come in, make a change, and be reasonably certain no bugs were introduced?