Counting Elements In Two Arrays And Swaps