Thankyou beta! I am glad you liked it. I hope that you are watching till the end and trying to understand what, how, and especially why of the problem. If you like our efforts, will you like to write a few words about us here (www.quora.com/What-are-the-good-websites-to-learn-data-structures-and-algorithms )
In the "release" while loop, whether the length update is really required? because while releasing the length won't be longer than the length when acquired, correct?
Beta, I regret to inform you that, I won't be able to answer/solve the personal doubts of each and every student over here. For clearing your doubts, you can join our community on telegram - t.me/pepcoding.
@@Pepcoding yessir , atleast try for one brute force solution and then aap humko optimised solution bata do warna interviewer pakad lega ki hamne already problem kiya hai
sir, plz help what is wrong in my code. import java.util.*; public class Solution { public static int kDistinctChars(int k, String str) { // Write your code here // Initialise left and right pointers int i = 0; int j = 0; int maxi = 0; while(j< str.length()) { Map map = new HashMap();
this was Awesome ! but sir i have a small confusion about the in hand salaries of fang companies..... PLZ REPLY.... How much amount can we expect to be transfered into our bank account every month ?.....excluding stocks, taxes and all from the ctc (specifically for Amazon and Microsoft) i know their BASE SALARY will be around 12-13lpa but how much inhand ? PLZ REPLY....waiting for reply sir....😊
c++ correct code can be submiited on coding ninja
#include
int kDistinctChars(int k, string &s)
{
int j=-1;
int ans=-1;
mapm;
for(int i=0;i
real cse engineering kaha hai -> pepcoding ke channel pe. Love u team pepcoding
acbbacc - size 7 hai tumhara 6 kyun AA raha hai
Thank you sir very much
Thankyou beta!
I am glad you liked it. I hope that you are watching till the end and trying to understand what, how, and especially why of the problem.
If you like our efforts, will you like to write a few words about us here (www.quora.com/What-are-the-good-websites-to-learn-data-structures-and-algorithms )
In the "release" while loop, whether the length update is really required? because while releasing the length won't be longer than the length when acquired, correct?
Beta, I regret to inform you that, I won't be able to answer/solve the personal doubts of each and every student over here. For clearing your doubts, you can join our community on telegram - t.me/pepcoding.
Yes. No need to see in the release. It will add the overhead. The relase will always be shorter window then acquire
@@rahulranjan7567 sahi kha sabhi ques mein mein release wala window chota aa rha hai, tu acquire wale mein hi ans collect krna bettr hai
Wow sir...❤️❤️
Glad it helped!
Keep learning.
And for better experience and well organised content visit nados.pepcoding.com
sir aap solution ka sath ma brute force + optimized + complexity bhi plz bata dejiya
it helps to think the approach
ok ji
@@Pepcoding yessir , atleast try for one brute force solution and then aap humko optimised solution bata do warna interviewer pakad lega ki hamne already problem kiya hai
just one line changes between exactly k and atlmost k
if(hm.size()==k+1)
break;
else;
maxlen=Math.max(maxlen,i-j);
you are the GOD of teaching .. and BEST in programming,,,, thankyou for such an amazing content.
Keep learning.
And for better experience and well organised content visit nados.pepcoding.com
sir pls make a video on Leetcode 395-> Longest Substring with At Least K Repeating Characters 🙏🙏🙏
Kya koi mereko aisa test case bta sakta ha jisme longest atmost k character ki substring exactly k character ke longest substring se different ho?
aaaa
k=2
Answer for atmost 2 is 4
Ans for exactly 2 is 0
@@dakshchhabra5975 nice🙌
sir, plz help what is wrong in my code.
import java.util.*;
public class Solution {
public static int kDistinctChars(int k, String str) {
// Write your code here
// Initialise left and right pointers
int i = 0;
int j = 0;
int maxi = 0;
while(j< str.length()) {
Map map = new HashMap();
if(map.get(str.charAt(j)) == null) {
map.put(str.charAt(j),1);
} else {
map.put(str.charAt(j), map.get(str.charAt(j))+1);
}
if(map.size() k) {
while(map.size() > k) {
map.put(str.charAt(i), map.get(str.charAt(i))-1);
if(map.get(str.charAt(i)) == 0) {
map.remove(str.charAt(i));
}
i++;
}
j++;
}
}
return maxi;
}
}
this was Awesome ! but sir i have a small confusion about the in hand salaries of fang companies..... PLZ REPLY.... How much amount can we expect to be transfered into our bank account every month ?.....excluding stocks, taxes and all from the ctc (specifically for Amazon and Microsoft) i know their BASE SALARY will be around 12-13lpa but how much inhand ? PLZ REPLY....waiting for reply sir....😊
Around 90K per month.
@@Pepcoding thanks for your reply sir..😇
@Ashutosh Kumar thanks for your suggestion bro 👍