18. 4Sum

Description

Here

Intuition

其实有个average O(N^2)的解法,就是sort之后,从头到尾开始扫 for 2 loop

然后假装是两个2sum来做

这个average 是 O(N^2),但其实sum不是uniformly distributed

Pitfall

Solution

Solution

results matching ""

    No results matching ""