class Solution:
def containsDuplicate(self, nums: List[int]) -> bool:
storing_list = []
counter = 0
for i in nums:
if i in storing_list:
counter += 1
else:
storing_list.append(i)
if counter > 0:
return True
else:
return False
This should run in O(n) time right? Leetcode is saying that time limit is exceeded, which means it runs too slow. I am confused on what the run time of this algorithm is.