18. 4Sum

pin two num[i], nums[j], then two sum

same as 3sum, just pin one more number, one more for loop

O(n^3)

O(k), number of solutions

Last updated

Was this helpful?