![Greg Hogg](/img/default-banner.jpg)
- 855
- 23 834 024
Greg Hogg
Canada
Приєднався 24 лис 2011
Welcome to the channel! I make videos about Data Science and Coding Interview Preparation. I also offer 1 on 1 tutoring for Data Structures & Algos, and Analytics / ML! Email me at greg.hogg1@outlook.com 😊
Time & Space Complexity - Big O Notation Explained
Please check my playlists for free DSA problem solutions:
ua-cam.com/play/PLKYEe2WisBTFlP0RlwfwPrdkvHrcTBUg-.html
ua-cam.com/play/PLKYEe2WisBTEK8_GVXySX9aDWBHk5fGwQ.html
ua-cam.com/play/PLKYEe2WisBTFZH-p9jgAOwtHy9_LGI28W.html
ua-cam.com/play/PLKYEe2WisBTH7I9sCPjSZCs-iBAH4ybmS.html
ua-cam.com/play/PLKYEe2WisBTH601scI_A008gm34oARlIp.html&si=DnCpq_RiFkObYn7p
ua-cam.com/play/PLKYEe2WisBTF21RGRtZfGGolpHmca_d3N.html
ua-cam.com/play/PLKYEe2WisBTH48RzVCL_LQrGW-ahPY44S.html
ua-cam.com/play/PLKYEe2WisBTHcWHAGWvKJuVMu5ElMA18M.html
ua-cam.com/play/PLKYEe2WisBTEY7eJBW7W-jbxlXCGb928P.html
ua-cam.com/play/PLKYEe2WisBTHCmJ6IfEMjg8o--Bvfc5gt.html
ua-cam.com/play/PLKYEe2WisBTFw-XWc-kwS3dkQeeSmvpg5.html
Learn Python and Data Science at mlnow.ai :)
Best Courses for Analytics:
---------------------------------------------------------------------------------------------------------
+ IBM Data Science (Python): bit.ly/3Rn00ZA
+ Google Analytics (R): bit.ly/3cPikLQ
+ SQL Basics: bit.ly/3Bd9nFu
Best Courses for Programming:
---------------------------------------------------------------------------------------------------------
+ Data Science in R: bit.ly/3RhvfFp
+ Python for Everybody: bit.ly/3ARQ1Ei
+ Data Structures & Algorithms: bit.ly/3CYR6wR
Best Courses for Machine Learning:
---------------------------------------------------------------------------------------------------------
+ Math Prerequisites: bit.ly/3ASUtTi
+ Machine Learning: bit.ly/3d1QATT
+ Deep Learning: bit.ly/3KPfint
+ ML Ops: bit.ly/3AWRrxE
Best Courses for Statistics:
---------------------------------------------------------------------------------------------------------
+ Introduction to Statistics: bit.ly/3QkEgvM
+ Statistics with Python: bit.ly/3BfwejF
+ Statistics with R: bit.ly/3QkicBJ
Best Courses for Big Data:
---------------------------------------------------------------------------------------------------------
+ Google Cloud Data Engineering: bit.ly/3RjHJw6
+ AWS Data Science: bit.ly/3TKnoBS
+ Big Data Specialization: bit.ly/3ANqSut
More Courses:
---------------------------------------------------------------------------------------------------------
+ Tableau: bit.ly/3q966AN
+ Excel: bit.ly/3RBxind
+ Computer Vision: bit.ly/3esxVS5
+ Natural Language Processing: bit.ly/3edXAgW
+ IBM Dev Ops: bit.ly/3RlVKt2
+ IBM Full Stack Cloud: bit.ly/3x0pOm6
+ Object Oriented Programming (Java): bit.ly/3Bfjn0K
+ TensorFlow Advanced Techniques: bit.ly/3BePQV2
+ TensorFlow Data and Deployment: bit.ly/3BbC5Xb
+ Generative Adversarial Networks / GANs (PyTorch): bit.ly/3RHQiRj
Become a Member of the Channel! bit.ly/3oOMrVH
Follow me on LinkedIn! www.linkedin.com/in/greghogg/
Full Disclosure:
Please note that I may earn a commission for purchases made at the above sites! I strongly believe in the material provided; I only recommend what I truly think is great. If you do choose to make purchases through these links; thank you for supporting the channel, it helps me make more free content like this!
ua-cam.com/play/PLKYEe2WisBTFlP0RlwfwPrdkvHrcTBUg-.html
ua-cam.com/play/PLKYEe2WisBTEK8_GVXySX9aDWBHk5fGwQ.html
ua-cam.com/play/PLKYEe2WisBTFZH-p9jgAOwtHy9_LGI28W.html
ua-cam.com/play/PLKYEe2WisBTH7I9sCPjSZCs-iBAH4ybmS.html
ua-cam.com/play/PLKYEe2WisBTH601scI_A008gm34oARlIp.html&si=DnCpq_RiFkObYn7p
ua-cam.com/play/PLKYEe2WisBTF21RGRtZfGGolpHmca_d3N.html
ua-cam.com/play/PLKYEe2WisBTH48RzVCL_LQrGW-ahPY44S.html
ua-cam.com/play/PLKYEe2WisBTHcWHAGWvKJuVMu5ElMA18M.html
ua-cam.com/play/PLKYEe2WisBTEY7eJBW7W-jbxlXCGb928P.html
ua-cam.com/play/PLKYEe2WisBTHCmJ6IfEMjg8o--Bvfc5gt.html
ua-cam.com/play/PLKYEe2WisBTFw-XWc-kwS3dkQeeSmvpg5.html
Learn Python and Data Science at mlnow.ai :)
Best Courses for Analytics:
---------------------------------------------------------------------------------------------------------
+ IBM Data Science (Python): bit.ly/3Rn00ZA
+ Google Analytics (R): bit.ly/3cPikLQ
+ SQL Basics: bit.ly/3Bd9nFu
Best Courses for Programming:
---------------------------------------------------------------------------------------------------------
+ Data Science in R: bit.ly/3RhvfFp
+ Python for Everybody: bit.ly/3ARQ1Ei
+ Data Structures & Algorithms: bit.ly/3CYR6wR
Best Courses for Machine Learning:
---------------------------------------------------------------------------------------------------------
+ Math Prerequisites: bit.ly/3ASUtTi
+ Machine Learning: bit.ly/3d1QATT
+ Deep Learning: bit.ly/3KPfint
+ ML Ops: bit.ly/3AWRrxE
Best Courses for Statistics:
---------------------------------------------------------------------------------------------------------
+ Introduction to Statistics: bit.ly/3QkEgvM
+ Statistics with Python: bit.ly/3BfwejF
+ Statistics with R: bit.ly/3QkicBJ
Best Courses for Big Data:
---------------------------------------------------------------------------------------------------------
+ Google Cloud Data Engineering: bit.ly/3RjHJw6
+ AWS Data Science: bit.ly/3TKnoBS
+ Big Data Specialization: bit.ly/3ANqSut
More Courses:
---------------------------------------------------------------------------------------------------------
+ Tableau: bit.ly/3q966AN
+ Excel: bit.ly/3RBxind
+ Computer Vision: bit.ly/3esxVS5
+ Natural Language Processing: bit.ly/3edXAgW
+ IBM Dev Ops: bit.ly/3RlVKt2
+ IBM Full Stack Cloud: bit.ly/3x0pOm6
+ Object Oriented Programming (Java): bit.ly/3Bfjn0K
+ TensorFlow Advanced Techniques: bit.ly/3BePQV2
+ TensorFlow Data and Deployment: bit.ly/3BbC5Xb
+ Generative Adversarial Networks / GANs (PyTorch): bit.ly/3RHQiRj
Become a Member of the Channel! bit.ly/3oOMrVH
Follow me on LinkedIn! www.linkedin.com/in/greghogg/
Full Disclosure:
Please note that I may earn a commission for purchases made at the above sites! I strongly believe in the material provided; I only recommend what I truly think is great. If you do choose to make purchases through these links; thank you for supporting the channel, it helps me make more free content like this!
Переглядів: 190
Відео
Implement Trie (Prefix Tree) - Leetcode 208 - Trees (Python)
Переглядів 78010 годин тому
The Python code for this problem can be found at my GitHub repo here: github.com/gahogg/Leetcode-Solutions/blob/main/Fibonacci Number - Leetcode 509.py Please check my playlists for free DSA problem solutions: ua-cam.com/play/PLKYEe2WisBTFlP0RlwfwPrdkvHrcTBUg-.html ua-cam.com/play/PLKYEe2WisBTEK8_GVXySX9aDWBHk5fGwQ.html ua-cam.com/play/PLKYEe2WisBTFZH-p9jgAOwtHy9_LGI28W.html ua-cam.com/play/PLK...
Minimum Absolute Difference in BST - Leetcode 530 - Trees (Python)
Переглядів 51412 годин тому
The Python code for this problem can be found at my GitHub repo here: github.com/gahogg/Leetcode-Solutions/blob/main/Fibonacci Number - Leetcode 509.py Please check my playlists for free DSA problem solutions: ua-cam.com/play/PLKYEe2WisBTFlP0RlwfwPrdkvHrcTBUg-.html ua-cam.com/play/PLKYEe2WisBTEK8_GVXySX9aDWBHk5fGwQ.html ua-cam.com/play/PLKYEe2WisBTFZH-p9jgAOwtHy9_LGI28W.html ua-cam.com/play/PLK...
Summary Ranges - Leetcode 228 - Top Questions (Python)
Переглядів 49612 годин тому
The Python code for this problem can be found at my GitHub repo here: github.com/gahogg/Leetcode-Solutions/blob/main/Fibonacci Number - Leetcode 509.py Please check my playlists for free DSA problem solutions: ua-cam.com/play/PLKYEe2WisBTFlP0RlwfwPrdkvHrcTBUg-.html ua-cam.com/play/PLKYEe2WisBTEK8_GVXySX9aDWBHk5fGwQ.html ua-cam.com/play/PLKYEe2WisBTFZH-p9jgAOwtHy9_LGI28W.html ua-cam.com/play/PLK...
Is Subsequence - Leetcode 392 - Top Questions (Python)
Переглядів 31912 годин тому
The Python code for this problem can be found at my GitHub repo here: github.com/gahogg/Leetcode-Solutions/blob/main/Fibonacci Number - Leetcode 509.py Please check my playlists for free DSA problem solutions: ua-cam.com/play/PLKYEe2WisBTFlP0RlwfwPrdkvHrcTBUg-.html ua-cam.com/play/PLKYEe2WisBTEK8_GVXySX9aDWBHk5fGwQ.html ua-cam.com/play/PLKYEe2WisBTFZH-p9jgAOwtHy9_LGI28W.html ua-cam.com/play/PLK...
Roman to Integer - Leetcode 13 - Top Questions (Python)
Переглядів 1 тис.12 годин тому
The Python code for this problem can be found at my GitHub repo here: github.com/gahogg/Leetcode-Solutions/blob/main/Fibonacci Number - Leetcode 509.py Please check my playlists for free DSA problem solutions: ua-cam.com/play/PLKYEe2WisBTFlP0RlwfwPrdkvHrcTBUg-.html ua-cam.com/play/PLKYEe2WisBTEK8_GVXySX9aDWBHk5fGwQ.html ua-cam.com/play/PLKYEe2WisBTFZH-p9jgAOwtHy9_LGI28W.html ua-cam.com/play/PLK...
Kth Smallest Element in a BST - Leetcode 230 - Trees (Python)
Переглядів 96014 годин тому
The Python code for this problem can be found at my GitHub repo here: github.com/gahogg/Leetcode-Solutions/blob/main/ Please check my playlists for free DSA problem solutions: ua-cam.com/play/PLKYEe2WisBTFlP0RlwfwPrdkvHrcTBUg-.html ua-cam.com/play/PLKYEe2WisBTEK8_GVXySX9aDWBHk5fGwQ.html ua-cam.com/play/PLKYEe2WisBTFZH-p9jgAOwtHy9_LGI28W.html ua-cam.com/play/PLKYEe2WisBTH7I9sCPjSZCs-iBAH4ybmS.ht...
Majority Element - Leetcode 169 - Top Questions (Python)
Переглядів 81914 годин тому
The Python code for this problem can be found at my GitHub repo here: github.com/gahogg/Leetcode-Solutions/blob/main/Fibonacci Number - Leetcode 509.py Please check my playlists for free DSA problem solutions: ua-cam.com/play/PLKYEe2WisBTFlP0RlwfwPrdkvHrcTBUg-.html ua-cam.com/play/PLKYEe2WisBTEK8_GVXySX9aDWBHk5fGwQ.html ua-cam.com/play/PLKYEe2WisBTFZH-p9jgAOwtHy9_LGI28W.html ua-cam.com/play/PLK...
Merge K Sorted Linked Lists - Leetcode 23 - Heaps (Python)
Переглядів 87817 годин тому
The Python code for this problem can be found at my GitHub repo here: github.com/gahogg/Leetcode-Solutions/blob/main/Fibonacci Number - Leetcode 509.py Please check my playlists for free DSA problem solutions: ua-cam.com/play/PLKYEe2WisBTFlP0RlwfwPrdkvHrcTBUg-.html ua-cam.com/play/PLKYEe2WisBTEK8_GVXySX9aDWBHk5fGwQ.html ua-cam.com/play/PLKYEe2WisBTFZH-p9jgAOwtHy9_LGI28W.html ua-cam.com/play/PLK...
Longest Common Prefix - Leetcode 14 - Top Questions (Python)
Переглядів 1,3 тис.17 годин тому
The Python code for this problem can be found at my GitHub repo here: github.com/gahogg/Leetcode-Solutions/blob/main/Fibonacci Number - Leetcode 509.py Please check my playlists for free DSA problem solutions: ua-cam.com/play/PLKYEe2WisBTFlP0RlwfwPrdkvHrcTBUg-.html ua-cam.com/play/PLKYEe2WisBTEK8_GVXySX9aDWBHk5fGwQ.html ua-cam.com/play/PLKYEe2WisBTFZH-p9jgAOwtHy9_LGI28W.html ua-cam.com/play/PLK...
Average of Levels in Binary Tree - Leetcode 637 - Trees (Python)
Переглядів 40517 годин тому
Related video - Binary Tree Level-Order Traversal - ua-cam.com/video/2_tm34ZtYT4/v-deo.html The Python code for this problem can be found at my GitHub repo here: github.com/gahogg/Leetcode-Solutions/blob/main/ Please check my playlists for free DSA problem solutions: ua-cam.com/play/PLKYEe2WisBTFlP0RlwfwPrdkvHrcTBUg-.html ua-cam.com/play/PLKYEe2WisBTEK8_GVXySX9aDWBHk5fGwQ.html ua-cam.com/play/P...
Path Sum - Leetcode 112 - Trees (Python)
Переглядів 88719 годин тому
Path Sum - Leetcode 112 - Trees (Python)
Minimum Size Subarray Sum - Leetcode 209 - Sliding Window (Python)
Переглядів 91719 годин тому
Minimum Size Subarray Sum - Leetcode 209 - Sliding Window (Python)
Symmetric Tree - Leetcode 101 - Trees (Python)
Переглядів 50219 годин тому
Symmetric Tree - Leetcode 101 - Trees (Python)
Best Time to Buy and Sell Stock - Leetcode 121 - Arrays, Strings and Hashing (Python)
Переглядів 1,2 тис.День тому
Best Time to Buy and Sell Stock - Leetcode 121 - Arrays, Strings and Hashing (Python)
Spiral Matrix - Leetcode 54 - Top Questions (Python)
Переглядів 1,4 тис.День тому
Spiral Matrix - Leetcode 54 - Top Questions (Python)
Rotate Image - Leetcode 48 - Top Questions (Python)
Переглядів 2,6 тис.День тому
Rotate Image - Leetcode 48 - Top Questions (Python)
Merge Intervals - Leetcode 56 - Top Questions (Python)
Переглядів 1,1 тис.День тому
Merge Intervals - Leetcode 56 - Top Questions (Python)
Kth Largest Element in an Array - Leetcode 215 - Heaps (Python)
Переглядів 2,4 тис.День тому
Kth Largest Element in an Array - Leetcode 215 - Heaps (Python)
Last Stone Weight - Leetcode 1046 - Heaps (Python)
Переглядів 1,2 тис.14 днів тому
Last Stone Weight - Leetcode 1046 - Heaps (Python)
Longest Common Subsequence - Leetcode 1143 - Dynamic Programming (Python)
Переглядів 1,1 тис.14 днів тому
Longest Common Subsequence - Leetcode 1143 - Dynamic Programming (Python)
Longest Increasing Subsequence - Leetcode 300 - Dynamic Programming (Python)
Переглядів 1,2 тис.14 днів тому
Longest Increasing Subsequence - Leetcode 300 - Dynamic Programming (Python)
Jump Game - Leetcode 55 - Dynamic Programming (Python)
Переглядів 84414 днів тому
Jump Game - Leetcode 55 - Dynamic Programming (Python)
Maximum Subarray (Kadane's Algorithm) - Leetcode 53 - Dynamic Programming (Python)
Переглядів 1,9 тис.14 днів тому
Maximum Subarray (Kadane's Algorithm) - Leetcode 53 - Dynamic Programming (Python)
Coin Change - Leetcode 322 - Dynamic Programming (Python)
Переглядів 2,1 тис.14 днів тому
Coin Change - Leetcode 322 - Dynamic Programming (Python)
Unique Paths - Leetcode 62 - Dynamic Programming (Python)
Переглядів 1 тис.14 днів тому
Unique Paths - Leetcode 62 - Dynamic Programming (Python)
Strong Noob Programmer vs O(n) Remote Engineer on Best Time to Buy and Sell Stock, Leetcode 121
Переглядів 9 тис.14 днів тому
Strong Noob Programmer vs O(n) Remote Engineer on Best Time to Buy and Sell Stock, Leetcode 121
Reversed O(n^2) Developer vs Skilled Heap O(n log n) Engineer on Last Stone Weight, Leetcode 1046
Переглядів 7 тис.14 днів тому
Reversed O(n^2) Developer vs Skilled Heap O(n log n) Engineer on Last Stone Weight, Leetcode 1046
Noob Developer vs Sports Fanatic Engineer on Search a 2D Matrix, Leetcode 74 (Full Video)
Переглядів 7 тис.21 день тому
Noob Developer vs Sports Fanatic Engineer on Search a 2D Matrix, Leetcode 74 (Full Video)
CHEATING Noob Coder vs Classy Senior Engineer on Permutations, Leetcode 46
Переглядів 6 тис.21 день тому
CHEATING Noob Coder vs Classy Senior Engineer on Permutations, Leetcode 46
Kindly zoom in while you are writing the code
Man. This is brilliant. I found it better than neetcode 🎉
This is very inefficient. There are cases where it will fail.
Did I just get pranked? There was literally nothing difficult about that. Was expecting some weird twist. Was it hard because you had to write all the uppercase and lowercase letters? 😂
ya, when you smoke regex in your crack pipe, and ask prospects this question, quit. It makes sense from an AI language analysis angle, but "is", "to", "it", "we", "he". The very premise behind the question is a koan, asking you for your method for no reason other than exhibition. Gotta ask my future employer to get real.
Hii Greg thanks a lot for this awesome video could you please make same content for HDBSCAN please
Forgive me if it’s flown over my head but isn’t there a fallacy in this algorithm? If you have [2,2,1,1,1,2,2,3,3,3] would the candidate not return as 3 even though 2 is the clear majority? So 1,2,1,0,1,0,1,0,1,2 where the final 2 is from the 3s. Maybe I’m just confused.
Okay nevermind after doing some due diligence I failed to realize that the algorithm assumes the list will always have a majority element where the element appearance is greater than the length / 2
This is how I learned stacks in college
Yes 🙌 Please don’t feel guilty about looking at the solution.
Yes I also waiting for machine learning
Will you do some machine learning videos again as well :) ?
You missed the most important part which is it has to be sorted 😅
What is considered as DP here!?
GOAT ❤
Why did you make max_distance and prev a list?
Also, if a hash table gets too full (ie passes its load balance), then a new larger table is created which takes O(n) time. But this happens very infrequently. This is similar to how dynamic arrays resize. So insertion is also amortized O(1) time.
This doesn’t seem O(n) to me, I can imagine the worst case to be when the whole list is a sequence. Then this script would check i numbers for every number in the list. This would give us n(n-1)/2 operations, which is O(n^2). The best case, aka no sequences in the list, would be linear, because you’re only checking once per element.
Ok, if you pop them out of the set as you check them, then you get O(n). Because then you won’t be running into the same one again. But then you have to check both to the right and the left of the number to make sure you’re always getting the largest sequence.
Excellent explanation. Thanks!! Very helpful
If this is noob level , then i don't know what level i am 💀
Repeat the same question you’ve already done in a different language - even better!
I use Paint, brother. There is an another tip that works for me: If the solution is in the standart library, use it! There are always tricky moments in the question desctiptions or solutions, that u can ignore or miss, so for the first, I literally SOLVE the question, and THEN try to do it WITHOUT standart library functions to be sure, that I really got it. For example: Search Insert Position and single number. - They are solved in a single line of code using STD functions, so firstly I do it. Then I write solution by myself. It makes you good in STD knowledge and you can consentrate on really important parts of a question.
I think I am dumb. I did not understand what he did.
I have a serious doubt I can only solve all questions on python language, is that okay.. does interviews allow me to use language of my choice?
yes, unless specified
Kabhi kabhi lagta h, ki coding karte karte kahi me bhi iske jaisa na ho jau😢😢
it still works if there are more than 2 candidates?
its probablistically almost always o(1) with proper hashing and load factor calculation, you should cover the equation to derive this
yea the comments are are a bum but they arent wrong sometimes lol
abap?
Solved the same question like 3 hours ago lol
I just finished watching Lec 5 of CS50 course in which they talk about hash tables. And mins later I see this, How TF did yt know ?😰
Same, I just finished a data structure and algorithm course in udemy. Scary huh?
Subscribe to the channel to get these in your feed everyday!
Real life work: first thing to do is checking is there is a library/package that already does it.
Log(2)base N ??
Just solved this yesterday and now this video comes in my feed
Awesome job!
Sorry I might be dumb or not understanding the question but why don't you look at the smallest value of all intervals and the biggest one to create the lower and upper bound of the interval asked?
You need multiple intervals, and yes this is something you would do
🟤🟢🔵🟣⚪️⚫️
Nice colours
Those are rookie number in this racket You need to solve atleast 500
Uhm says who lol
@@GregHogg says someone who was leetcoding for 4 yrs & got into FAANG 2 yrs ago 😂 Now 300+ is not enough, competition has increased a lot
@@nammi895 Because you work at FAANG you can adamantly state you need over 500? I know lots of others that would disagree. Also the number of questions doesn't really mean anything
And I have solved 1096
What 😂
Big words, no listen
Latterly you are telling me what I need to hear 😂❤
What’s a RL agent policy function for the same??
Uhh 😅
Dont see why thats a big deal just look at your code and think lol
It's for those that are unable