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)
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Because
numbers.contains()
is a list and to see if it contains the element would loop through the whole list (basicallyO(n)
. That makes the solution to have two nested loops and going fullO(n^2)