Given two variables, x and y, swap two variables without using a third variable.
class Solution {
public:
/**
* @param x an integer
* @param y an integer
* @return nothing
*/
void swap(int &x, int &y) {
// Write your code here
x = x ^ y;
y = x ^ y;
x = x ^ y;
}
};