leetcode986】的更多相关文章

Given two lists of closed intervals, each list of intervals is pairwise disjoint and in sorted order. Return the intersection of these two interval lists. (Formally, a closed interval [a, b] (with a <= b) denotes the set of real numbers x with a <=…
class Solution: def judgeIntersection(self,a:'Interval',b:'Interval'): #返回值1,bool类型,是否有交集:True-有交集,False-无交集 #返回值2,int类型,哪个先结束:0-A先结束,1-B先结束,2-AB同时结束 #返回值3,Interval类型,交集的值:有交集时是Interval实例,无交集时是None intersect = False firstEnd = 2 if a.end < b.end: fir…