Skip to content

Latest commit

 

History

History

15-3sum

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

3 sum

https://leetcode.com/problems/3sum/

Time complexity: O(n*n) Space complexity: O(n)

Time complexity: O(n*n) Space complexity: O(n)

Time complexity: O(n*n) Space complexity: O(n)

While the asymptotic complexity is the same, this algorithm is noticeably slower than the previous approach. Lookups in a hashset, though requiring a constant time, are expensive compared to the direct memory access.