Contains Duplicate - LeetCode 217 - Python

Published: 30 May 2024
on channel: 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


Watch video Contains Duplicate - LeetCode 217 - Python online without registration, duration hours minute second in high quality. This video was added by user Gordon Zhu 30 May 2024, don't forget to share it with your friends and acquaintances, it has been viewed on our site 299 once and liked it 20 people.