Can't you just sort both arrays and compare them? I'm not sure we need two sets here.