题解 | #无缓存交换#
无缓存交换
http://www.nowcoder.com/practice/845ec89145b04b2b855d020d9c3ea2ef
# -*- coding:utf-8 -*-
class Exchange:
def exchangeAB(self, AB):
# write code here
# 使用异或性质
AB[0] ^= AB[1]
AB[1] ^= AB[0]
AB[0] ^= AB[1]
return AB
