H Index - Leetcode 274 - Arrays & Strings (Python)

  Рет қаралды 11,071

Greg Hogg

Greg Hogg

Күн бұрын

Master Data Structures & Algorithms for FREE at AlgoMap.io/
Code solutions in Python, Java, C++ and JS for this can be found at my GitHub repo here: github.com/gah...
Complete DSA Pathway Zero to Hero: • Data Structures & Algo...
Please check my playlists for free DSA problem solutions:
• Fundamental DSA Theory
• Array & String Questions
• 2 Pointers Questions
• Sliding Window Questions
• Binary Search Questions
• Stack Questions
• Linked List Questions
• Tree Questions
• Heap Questions
• Recursive Backtracking...
• Graph Questions
• Dynamic Programming (D...
My Data Science & ML KZbin Playlist: • Greg's Path to Become ...
Learn Python and Data Science FASTER at mlnow.ai :)
Support the content: / @greghogg
Follow me on Instagram: / greghogg5
Connect with me on LinkedIn: / greghogg
Follow me on TikTok: / greghogg5
Coursera Plus: imp.i384100.ne...
My Favorite Courses:
Data Structures & Algorithms:
UCalifornia San Diego DSA: imp.i384100.ne...
Stanford Algorithms: imp.i384100.ne...
Python Data Structures: imp.i384100.ne...
Meta Coding Interview Prep: imp.i384100.ne...
Python:
UMichigan Python for Everybody: imp.i384100.ne...
Python Mastery from MLNOW.ai: mlnow.ai/cours...
Google IT Automation w/ Python: imp.i384100.ne...
Web Dev / Full Stack:
Meta Front-End Developer: imp.i384100.ne...
IBM Full Stack Developer: imp.i384100.ne...
Meta Back-End Developer: imp.i384100.ne...
John Hopkins HTML, CSS & JS: imp.i384100.ne...
IBM DevOps: imp.i384100.ne...
Cloud Development:
AWS Fundamentals: imp.i384100.ne...
GCP Cloud Engineer: imp.i384100.ne...
Microsoft Azure Fundamentals: imp.i384100.ne...
Game Development:
Michigan State Unity Development: imp.i384100.ne...
UColorado C++ for Unreal Engine: www.coursera.o...
SQL & Data Science:
SQL by MLNOW.ai: mlnow.ai/cours...
Python for Data Science by MLNOW.ai: mlnow.ai/cours...
Google Data Analytics: imp.i384100.ne...
IBM Data Science: imp.i384100.ne...
IBM Data Engineer: imp.i384100.ne...
Machine Learning & AI:
ML Mastery at MLNOW.ai: mlnow.ai/cours...
ML w/ Andrew Ng: www.coursera.o...
Deep Learning w/ Andrew Ng: imp.i384100.ne...

Пікірлер: 35
@GregHogg
@GregHogg 5 ай бұрын
Master Data Structures & Algorithms for FREE at AlgoMap.io/
@mohammadrafi895
@mohammadrafi895 5 ай бұрын
I think both Array and DP problems are equally hard. In DP, you have to catch the pattern which is the hardest bit. And for array problems, you never know when any concept out of the blue can be applied like Counting Sort.
@NikitaNair
@NikitaNair Ай бұрын
Amazing logic using counting sort!!!
@spacetime_wanderer
@spacetime_wanderer 4 ай бұрын
Amazing explanation Greg! You helped me to build my intuition. Subscribed!
@ackeman9386
@ackeman9386 5 ай бұрын
Teaching me as if I were dumb. I love that!
@GregHogg
@GregHogg 5 ай бұрын
This one is pretty tricky so I had to really dumb it down lol
@survivourff7014
@survivourff7014 5 ай бұрын
Your dsa videos are really good…pls try to cover all the topics bro
@alisheheryar1770
@alisheheryar1770 2 ай бұрын
Good job of Brute Force and Optimal solution.
@dreadknot66
@dreadknot66 5 ай бұрын
Hey, Greg! Great explanation. Can you please make a video on LRU Cache?
@pooyadehghani4324
@pooyadehghani4324 13 күн бұрын
class Solution: def hIndex(self, citations: List[int]) -> int: n = len(citations) citations.sort() h_index = 0 for i in range(1,n+1): if citations[n - i] >= i: h_index += 1 return h_index
@gopircr
@gopircr 2 ай бұрын
Nice explanation for a confusing problem
@AdoniyasGetnet
@AdoniyasGetnet 4 ай бұрын
class Solution: def hIndex(self, citations): citations.sort(reverse=True) print(citations) j=0 n=len(citations) for i in citations: if i>j: j+=1 return j
@the_dopekid9311
@the_dopekid9311 24 күн бұрын
Great solution, can you pls explain the logic here once.
@sharpiemaster7351
@sharpiemaster7351 5 ай бұрын
What drawing software do you use?
@edwinantonius63
@edwinantonius63 5 ай бұрын
I like this solution, my initial gut feeling made me thing about creating a dictionary of citation counts paired with a rank....
@CyrusWong-yq4uw
@CyrusWong-yq4uw 5 ай бұрын
Hi Greg, can you please upload a tutorial about Leetcode Question 34 Find First and Last Position of Element in Sorted Array? I am struggling on it and I need some help. Thank you so much !
@GuilhermeDugaichdeOliveira
@GuilhermeDugaichdeOliveira 5 ай бұрын
Great one! What is the app you use for drawing?
@chisomedoka5651
@chisomedoka5651 3 ай бұрын
Mira
@AnkitGupta-vg1uc
@AnkitGupta-vg1uc 2 ай бұрын
Good explanation.
@sekharkumar3824
@sekharkumar3824 2 ай бұрын
OMG if you start explaining even a small kid can understand any complex problem easy-peasy
@Democratic_people
@Democratic_people 2 ай бұрын
amazing bro.
@survivourff7014
@survivourff7014 5 ай бұрын
Bro…pls make a video on bit manipulation
@adithyar3160
@adithyar3160 5 ай бұрын
hi @gregg buddy, can you do a video on LRU cache. Thank you in advance.
@GregHogg
@GregHogg 5 ай бұрын
Okay I'll try
@HùngTô-i4d
@HùngTô-i4d 3 ай бұрын
Thanks
@mohammadrafi895
@mohammadrafi895 5 ай бұрын
You should start teaching online officially.
@GregHogg
@GregHogg 5 ай бұрын
What does that mean exactly haha
@mohammadrafi895
@mohammadrafi895 5 ай бұрын
@@GregHogg Like starting your website where you offer paid courses. :)
@mohammadrafi895
@mohammadrafi895 5 ай бұрын
@@GregHogg You have the most articulate way of teaching. I've seen any tutors that teach so elegantly. I'd love to see your courses where you go in-depth about concepts.
@sammmywammmy
@sammmywammmy 4 күн бұрын
good explanation but feels too fast
@0xDomain
@0xDomain 23 күн бұрын
I used sorting to solve this
@xAllaboutx
@xAllaboutx 2 ай бұрын
nice, I have got: "Beats 91%" with this, I kept using the n variable, skipping the h variable, no need for h = n
@BraulioRojas-tf8pv
@BraulioRojas-tf8pv 2 ай бұрын
I think it was only to make it clearer as they're asking for the H Index
@freesoftwares6042
@freesoftwares6042 4 ай бұрын
oki got thru this , but how tf a test case [11,15] is supose to return 2 , is leetcode drunk orsomething?
@ardenmatikyan9658
@ardenmatikyan9658 3 ай бұрын
There are 2 papers with at least 2 citations. The max h is 2
How I would learn Leetcode if I could start over
18:03
NeetCodeIO
Рет қаралды 802 М.
Гениальное изобретение из обычного стаканчика!
00:31
Лютая физика | Олимпиадная физика
Рет қаралды 4,8 МЛН
人是不能做到吗?#火影忍者 #家人  #佐助
00:20
火影忍者一家
Рет қаралды 20 МЛН
Don’t Choose The Wrong Box 😱
00:41
Topper Guild
Рет қаралды 62 МЛН
H-Index | LeetCode 274 | C++, Java, Python
11:57
Knowledge Center
Рет қаралды 32 М.
The LeetCode Fallacy
6:08
NeetCode
Рет қаралды 602 М.
Add Binary - Leetcode 67 - Bit Manipulation (Python)
8:20
Greg Hogg
Рет қаралды 10 М.
Group Anagrams - Leetcode 49 - Hashmaps & Sets (Python)
7:28
Greg Hogg
Рет қаралды 18 М.
Roman to Integer - Leetcode 13 - Arrays & Strings (Python)
6:15
Why is everyone LYING?
7:56
NeetCodeIO
Рет қаралды 382 М.
These coding projects give you an unfair advantage
8:13
Jason Goodison
Рет қаралды 1,1 МЛН
How to Solve ANY LeetCode Problem (Step-by-Step)
12:37
Codebagel
Рет қаралды 346 М.
Гениальное изобретение из обычного стаканчика!
00:31
Лютая физика | Олимпиадная физика
Рет қаралды 4,8 МЛН