find all duplicates in an array leetcode | leetcode 442

preview_player
Показать описание


#Set #Duplicates #ConstantSpace #Linear #FindAllDuplicatesinanArray #Coding #Programming #Interview #Practice #Leetcode #Easy #442 #Algorithm #Java #Preparation
Комментарии
Автор

How did you came up with the idea that marking visited node negative will work ? It would be great if you could provide a reason/ reference for the same.

gandharjoshi
Автор

I can solve this O(n) speed like two sum but it requires O(n) space as well. I am not entirely sure how one can do this in O(1) but I probably need to practice in order to get my skill up to that level.

monkeytrollhunter
Автор

what is font being used here in writing code ? Is it default font of your browser?

sunilpulla
Автор

Your set solution is not O(n). Set insertion is log(n) and inserting n elements in the set is nlog(n).

athiban
Автор

What if no are greater than the size of array ?

gurpreetgandhi
Автор

volume so low, very difficult to understand

vigyanhoon