class Solution:
    def fairCandySwap(self, A, B):
        """
        :type A: List[int]
        :type B: List[int]
        :rtype: List[int]
        """
        diff=int((sum(A)-sum(B))/2)
        A,B=set(A), set(B)
        for i in A:
            if i-diff in B:
                return [i,i-diff]
s=Solution()
A = [1,2,5]
B = [2,4]
print(s.fairCandySwap(A,B))
# 如果没有set这一步 time limited error



