Тёмный
No video :(

Top K Frequent Elements (LeetCode 347) | Neetcode 5/ 150 | Bharath Chandra (తెలుగు) 

Bharath Chandra (తెలుగు)
Подписаться 7 тыс.
Просмотров 1,4 тыс.
50% 1

Hello guys, cheers to another piece of learning. Today I talked about the "Top K Frequent Elements" problem which is the first in Neetcode 150 list. It is one of the most asked questions in interviews and has some interesting ways to solve it.
In the above video, I showed all the different logics with which the problem can be solved and also the codes to those logics in Python. Let me know if you got a hold of the logic?
Link to Hashsets and Hashmaps video - • Hashsets and HashMaps ...
Link to the problem - leetcode.com/p...
Link to Java, C++ solution - leetcode.com/p...
Link to Python Solution - leetcode.com/p...
Link to Neetcode 150 - neetcode.io/pr...
Regular updates from me on Discord, Insta and Telegram. I post job notifications of telegram and discord
Insta - / bharathh_chandraa
Telegram - t.me/thebharat...
Discord - / discord
00:00 - Introduction and Problem Statement
01:51 - HashMap step
07:15 - Approach 1 with intuition
13:57 - Approach 2 with intution
22:49 - Approach 2 example
34:46 - Pseudocode
38:40 - Code and Conclusion

Опубликовано:

 

17 авг 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 29   
@Bobby-j3n
@Bobby-j3n 7 дней назад
love u bro .... telugu community ki DSA kastalu teerinatte mee chaneel tho....... plz don't stop until this is enough to reach DSA advance
@Manjith-1887
@Manjith-1887 Месяц назад
Excited For Daily Two Problems 🤞💥
@bharathh_chandraa
@bharathh_chandraa Месяц назад
So am I Manjith! Brace yourselves🙌🏻
@vaneetha_here_navaneetha
@vaneetha_here_navaneetha Месяц назад
class Solution(object): def topKFrequent(self, nums, k): hashMap={} for i in nums: if i in hashMap: hashMap[i] = hashMap[i]+1 else: hashMap[i] = 1 l=[] for i in range(k): max_key = max(hashMap, key=hashMap.get) l.append(max_key) del hashMap[max_key] return l before staring the video
@electron-u8p
@electron-u8p Месяц назад
5/150 ✅️
@VendiChitralu
@VendiChitralu 11 дней назад
Bro expalination peaks but code tho step by step explain cheyy 🙏
@_Siva_krishna_karri
@_Siva_krishna_karri Месяц назад
Anna nice explanation with real time examples. hope anni sums lo ila real time examples use cheyali ani korukuntunna🤩
@techdevilsgaming1574
@techdevilsgaming1574 Месяц назад
Bro code Java lo rayyandi
@vaneetha_here_navaneetha
@vaneetha_here_navaneetha Месяц назад
lokesh anna,something is missing,ee video ki previous videos ki mundhu videos laga ney cheyandi anna better ga artham avuthundhi. meru em worry avvakandi viewers ni memu thisukoni vastham. but ee video little bit tricky to understand
@vaneetha_here_navaneetha
@vaneetha_here_navaneetha Месяц назад
linkedin link petttaledhu🤔
@learn_with_bharath
@learn_with_bharath 27 дней назад
bro try to minimize the length of video bcz seeing long video can be bored or not intrested to watch end overall nice explanation about every possible example thanks bro
@bharathh_chandraa
@bharathh_chandraa 27 дней назад
Sure Bharath! Keep Coding
@EnglishBytesForTelugu
@EnglishBytesForTelugu 29 дней назад
Bro after frequency Calculate chesaka Hash Map ni sort (Based on values chesi) K keys ni return chesthe avvutundaa?
@bharathh_chandraa
@bharathh_chandraa 27 дней назад
Yes, if your language supports sorting based on values.
@ranjanreddy3296
@ranjanreddy3296 Месяц назад
Bro only 2 approaches kada.. 1) hashmap with sorting, 2) hashmap without sorting.. TImeline lo approach 2 and approach 3 undhi, is that a typo ? Also approach 2 lo kuda you need to create a 2nd hash map right ? else how do you know the key if you just sort the values.
@bharathh_chandraa
@bharathh_chandraa Месяц назад
Thanks for pointing this out Ranjan. 2 approaches ee unnay typo adhi. Sorting approach lo you need an other array of pairs to maintain the keys and values together while sorting
@kesavakk124
@kesavakk124 Месяц назад
Make a video on heaps in python
@bharathh_chandraa
@bharathh_chandraa Месяц назад
Ee playlist lo anni data structures paina problems osthay. Heaps problems solve chese mundhu concept discuss chesthanu
@kesavakk124
@kesavakk124 Месяц назад
@@bharathh_chandraa ok bruh Your videos are damn good.Thanks for helping us
@shanmukharao3378
@shanmukharao3378 29 дней назад
Hi Bharath, C# doesn't have HashTable Sort by value. any other way we can do. By Value.
@bharathh_chandraa
@bharathh_chandraa 29 дней назад
You have to create an array of pairs. And then sort based on values, most of the languages don’t allow sort by values. Else use the countArray approach, it is more efficient
@shanmukharao3378
@shanmukharao3378 29 дней назад
​@@bharathh_chandraa Approach 2: Completed. All Test case passed. But in c# when using Hashtable every time i have to cast value.
@abhiramvanama5266
@abhiramvanama5266 Месяц назад
python lone continue cheyyi anna , itss looks like psuedo code , and pyhton lo cheppe vallu chala thakkuva unnaru
@maheswara_pradeep8235
@maheswara_pradeep8235 Месяц назад
Let's goooooo. Solved it using sort
@bharathh_chandraa
@bharathh_chandraa Месяц назад
Another feather in your hat now!
@pullareddy_yanamala_
@pullareddy_yanamala_ Месяц назад
niceee🎉
@ghani2342
@ghani2342 Месяц назад
Thanks anna
@VamsiNathReddy-hh8yd
@VamsiNathReddy-hh8yd Месяц назад
Nice anna
Далее
Why Is C SO Dangerous?  #programming #coding #lowcode
0:51
MIT Introduction to Deep Learning | 6.S191
1:09:58
Просмотров 474 тыс.