Swaps the elements at indices i and j in the array arr and assign them to be zero.