Contains Duplicate - LeetCode 217 - Python

Опубликовано: 30 Май 2024
на канале: Gordon Zhu
299
20

Most teachers introduce solutions as fully-formed recipes. But in doing so, they totally miss how solutions are DISCOVERED. In painstaking detail, I go through this crucial missing piece and demonstrate how to methodically attack problems from every possible angle.

My teaching: https://watchandcode.com
Link to problem: https://leetcode.com/problems/contain...

0:00 Problem statement
0:15 Initial thought process
0:40 Brute force
1:47 Can we beat O(n^2)?
2:30 Sorting
3:00 Can we beat O(n*log(n))?
3:38 Big O analysis
4:11 Initial map approach
4:44 Equivalent set approach
5:18 Using Python's Counter class
6:16 Thought process for indirect strategy
7:06 Indirect map and set implementations
7:59 Direct design versus indirect
8:26 Can we go faster?
8:56 Reflections


Смотрите видео Contains Duplicate - LeetCode 217 - Python онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Gordon Zhu 30 Май 2024, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 299 раз и оно понравилось 20 людям.