DEV Community

Discussion on: Daily Coding Problem #1

Collapse
 
cwetanow profile image
Ivan

Because numbers.contains() is a list and to see if it contains the element would loop through the whole list (basically O(n). That makes the solution to have two nested loops and going full O(n^2)