擅长:python、mysql、java
<p>你需要确定地循环浏览列表。为了提高效率,可以从前两个列表(或其副本)中删除选中的元素,并在发现要处理的元素后中断嵌套循环。我认为这将大大提高效率</p>
<p>示例(伪代码):</p>
<pre><code>while a or b:
x = pop(a)
y = pop(b)
# compare x and y (try to use built-in methods such as map, filter etc. to make it fast)
# append to one of the differences dictionary's list
</code></pre>