began problem, solved in o(n)^2, but needs O(n)

This commit is contained in:
Jacob Delgado 2023-07-11 02:37:28 -07:00
parent e7331f6d89
commit f5c523e98f

View File

@ -0,0 +1,12 @@
def productExceptSelf(nums):
"""
:type nums: List[int]
:rtype: List[int]
"""
answer = nums
for i in range(len(nums)):
if answer[i] == nums[i]:
return answer
productExceptSelf([1,2,3,4])