627. 交换工资

https://leetcode-cn.com/problems/swap-salary/

解法一:用异或

结论:f⊕m的结果为G,则通过变换可以得到对方:
f ⊕ G = m
m ⊕ G = f
update salary set sex = CHAR(ASCII('f') ^ ASCII('m') ^ ASCII(sex));

最后更新于