filmov
tv
Contains Duplicate - leetcode 217 - 3 Simple solutions

Показать описание
Today we will solve "Contains Duplicate" problem from #leetcode. This question has been asked by #google , #facebook (#meta), #amazon, #apple , #bloomberg , #microsoft , #adobe, and so many other companies.
We will use 3 solutions: one by using a hashmap, second by using a set and last one by sorting the input array to tackle this problem.
Please check the channel page for more #leetcode solution videos. Also don't forget to like, comment, and subscribe. Hope you enjoy the video!
Chapters:
0:00 Intro and question
0:18 Examples
0:35 Brute-force solution
0:46 Hash map Solution
1:11 Set Solution
1:41 Sort Solution
2:24 Code walk through for all solutions
4:20 Time and Space Complexity
We will use 3 solutions: one by using a hashmap, second by using a set and last one by sorting the input array to tackle this problem.
Please check the channel page for more #leetcode solution videos. Also don't forget to like, comment, and subscribe. Hope you enjoy the video!
Chapters:
0:00 Intro and question
0:18 Examples
0:35 Brute-force solution
0:46 Hash map Solution
1:11 Set Solution
1:41 Sort Solution
2:24 Code walk through for all solutions
4:20 Time and Space Complexity