1、时间上相邻query,前缀去重
输入:[(AB, 2019-12-25 12:11:23), (A, 2019-12-25 12:11:22), (ABC, 2019-12-25
12:11:22), (BCD, 2019-12-25 12:11:30), (B, 2019-12-25 12:11:31)]
输出:[ (ABC, 2019-12-25 12:11:22), (BCD, 2019-12-25 12:11:30), (B, 2019-12-25
12:11:31)]
l2=[]
ll2=[]
ll3 =[]
for i in li:
l2.append(i[1])
ll2=set(l2)
if ll2 not in li:
ll3.append(li.pop())
print(ll3)