Complete mergeSortByXorY