Размер видео: 1280 X 720853 X 480640 X 360
Показать панель управления
Автовоспроизведение
Автоповтор
Like target for this video is 100. Please do like if you have understood the explanation.😊😊
Thank you
concept clear and great explanation. Keep it up❤
how do you think of edge cases while problem solving, would love some video or content on this
Bhaiya when will graph series completed and dp series start?
Hey, qq - which approach out of the last two do you think is more optimal? The one using Hashmap or the one using Hashset?
both have same tc, you can explain anyone to the interviewer.
Will sorting work?
grt explain
"why single set fails" Jb bhi ata hu aap kuch naya sikha dete ho bhaiya. Thankyou 😍😍
Thanks 😊
Day5 of request for do series
class Solution { public String kthDistinct(String[] arr, int k) { HashMap map=new HashMap(); for(int i=0;i
Thank you sir New subscriber 🩷
public static String kthDistinct(String[] arr, int k) { Map mp = new LinkedHashMap(); for(var str : arr){ mp.put(str,mp.getOrDefault(str,0)+1); } int tmp = k; for(String freq : mp.keySet()){ if(mp.get(freq) > 1) continue; if(mp.get(freq)==1){ tmp--; } if(tmp==0) return freq; } return ""; } this is my brute force solution is this efficient ?
You used linkedHashMap nice 👌👌
Like target for this video is 100. Please do like if you have understood the explanation.😊😊
Thank you
concept clear and great explanation. Keep it up❤
how do you think of edge cases while problem solving, would love some video or content on this
Bhaiya when will graph series completed and dp series start?
Hey, qq - which approach out of the last two do you think is more optimal? The one using Hashmap or the one using Hashset?
both have same tc, you can explain anyone to the interviewer.
Will sorting work?
grt explain
"why single set fails" Jb bhi ata hu aap kuch naya sikha dete ho bhaiya. Thankyou 😍😍
Thanks 😊
Day5 of request for do series
class Solution {
public String kthDistinct(String[] arr, int k) {
HashMap map=new HashMap();
for(int i=0;i
Thank you sir
New subscriber 🩷
public static String kthDistinct(String[] arr, int k) {
Map mp = new LinkedHashMap();
for(var str : arr){
mp.put(str,mp.getOrDefault(str,0)+1);
}
int tmp = k;
for(String freq : mp.keySet()){
if(mp.get(freq) > 1) continue;
if(mp.get(freq)==1){
tmp--;
}
if(tmp==0) return freq;
}
return "";
} this is my brute force solution is this efficient ?
You used linkedHashMap nice 👌👌