Adding XOR swap algorithm. Removing duplicate code in general problems.