LeetCode #442 - Finding Duplicates in Array | Tutorial w/Python | Explained Job Interview Question

preview_player
Показать описание
LeetCode is looking for a specific way to solve! O(1) preferred... Did I choose the right way? Pshh, no! Watch and see what works!

_________________________________________

_________________________________________

“Messiah died for our sins, just as the Scriptures said.” -1 Cor. 15:3b

#leetcode #jobinterview #arrayduplicates
Рекомендации по теме
Комментарии
Автор

Tough problem! I would have to know how it is used to solve. I'm horrible at solving code problems unless I have a specific use case to anchor my understanding. I digress...

FREESPUR
Автор

how about this solution?
thanks for the videos, I think the presented solution was really out of the box, how about this solution?

A = [4, 3, 2, 7, 8, 2, 3, 1]
def
dublicated_elems = []
list_of_elem=[]
for elem in input_list:
if elem not in list_of_elem:
list_of_elem.append(elem)
else:
dublicated_elems.append(elem)
return sorted(dublicated_elems)

print(return_dublciates(A))

CanerKilinc
Автор

Now suppose the first index value was an 11, when that is subtracted it gives 10 as the new index, but if the array does not have a length of 10 what happens. i love this video by the way and am trying to learn more about arrays so can you help me understand what would happen in this situation

leonarine