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
In questa pagina del sito puoi guardare il video online Contains Duplicate - LeetCode 217 - Python della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Gordon Zhu 30 May 2024, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 812 volte e gli è piaciuto 36 spettatori. Buona visione!