摘要: 思路:对两个list 排序,从小到大依次对比两个数组元素的差 class Solution(object): def smallestDifference(self, a, b): """ :type a: List[int] :type b: List[int] :rtype: int """ a 阅读全文
posted @ 2020-05-15 21:08 SuckChen 阅读(191) 评论(0) 推荐(0)
摘要: 用一个队列存放每一层的节点, 遍历该队列再把下一层的节点存放到队列, 循环终止:队列为空 # Definition for a binary tree node. # class TreeNode(object): # def __init__(self, x): # self.val = x # 阅读全文
posted @ 2020-05-15 13:14 SuckChen 阅读(263) 评论(0) 推荐(0)