Two Sum II - LeetCode 167 - Python (with proofs thinking)
600 بار بازدید -
ماه قبل
-
It can be really hard
It can be really hard to know if an idea will really work or if you should dismiss it because it's wrong in subtle ways. The best programmers recognize this and take deliberate steps to get better at proving and disproving ideas, but this is super rare. Most people just throw stuff at the wall and hope that it works.
"Pray and hope" is okay at the beginner level, but will become a serious limiting factor if you want to go past that. This is why so much of my teaching is focused around helping students reason about correctness, and I try to model it as much as I can, like I did here in this video.
My teaching work: https://watchandcode.com
My video for the "original" Two Sum: Two Sum - LeetCode 1 - Python
Problem link: https://leetcode.com/problems/two-sum...
0:00 Two Sum II problem statement is silly
0:27 Example analysis
1:00 Exploit sorting? [Key Question]
1:33 Smallest & Largest? [Key Question]
3:57 Other Cases? [Key Question]
5:36 Time & Space Complexity
5:59 Implementation
7:40 The Rare (Killer) Skill
"Pray and hope" is okay at the beginner level, but will become a serious limiting factor if you want to go past that. This is why so much of my teaching is focused around helping students reason about correctness, and I try to model it as much as I can, like I did here in this video.
My teaching work: https://watchandcode.com
My video for the "original" Two Sum: Two Sum - LeetCode 1 - Python
Problem link: https://leetcode.com/problems/two-sum...
0:00 Two Sum II problem statement is silly
0:27 Example analysis
1:00 Exploit sorting? [Key Question]
1:33 Smallest & Largest? [Key Question]
3:57 Other Cases? [Key Question]
5:36 Time & Space Complexity
5:59 Implementation
7:40 The Rare (Killer) Skill
ماه قبل
در تاریخ 1403/04/26 منتشر شده
است.
600
بـار بازدید شده