Find All Duplicates in an Array | Leetcode 442 | Live coding session 🔥🔥🔥

preview_player
Показать описание
Here is the solution to "Find All Duplicates in an Array" leetcode question. Hope you have a great time going through it.

1) 0:00 Explaining the problem out loud
2) 1:10 Algorithm walkthrough
3) 2:00 Solution approach
4) 6:00 Coding

For discussion/feedback

PS : Please increase the speed to 1.25X
Рекомендации по теме
Комментарии
Автор

Tested this solution. Got the following output

Runtime: 5 ms, faster than 89.19% of Java online submissions for Find All Duplicates in an Array.
Memory Usage: 47.8 MB, less than 80.56% of Java online submissions for Find All Duplicates in an Array.

This solution is quite effective in terms of time and space. I guess the leetcode site had some latency when doing the live coding of this solution. Who knows, anyway thank you as always.

pubamx
Автор

Amazing:)
spend lot of time in thinking the solution with O(1)..then saw your solution and found that its 1 to n numbers.:(
thanks a lot....best wishes

ashishkalra
Автор

how'd you got the context of the second approach?

harshalkaigaonkar