deffind_second_large_num(num_list):"""找出数组第2大的数字"""方法一直接排序,...
A,B中相同元素:print(set(A)&set(B))A,B中不同元素:print(set(A)^set(B))
list1=[1,2,3]list2=[3,4,5]set1=set(list1)set2=set(list2)print(set1&set2)print(set1^set2)
//用hash/桶的思路$res=[];foreach($dataas$item){if(array_key_exists($item,$res)){++$res[$item];...