This is exactly what I was looking for. Amazing explanation Please make a playlist which is based on different coding patterns so that we can identify the pattern of problems and we can attempt it. Thank you
@ramannaagre7938 Жыл бұрын
Great explanation. Keep posting similar videos.
@Itsme1n1ly Жыл бұрын
Excellent explanation 🎉 Thanks 🙏
@studentcare17502 жыл бұрын
super mam keep going for more number of coding questions🤩🤩🤩🤩
@codewithease-byvarsha Жыл бұрын
Thanks, stay tuned for more videos like this!
@manusklm11615 ай бұрын
in place of "While" we can just use a if statement for shrinking right? bcz there is no need of shrinking the window less than the already found longest sub array's length ..there by T.C reduces to O(N) from O(N)
@imPriyansh77 Жыл бұрын
Great Explanation... Can you explain that why you've not used set in this problem, as we want to store unique characters & their count ? What is the advantage of using unordered map over a set ?
@codewithease-byvarsha Жыл бұрын
well, fair enough, you use a set to store unique characters but how will you store the corresponding count of each character?
@imPriyansh77 Жыл бұрын
@@codewithease-byvarsha Yes, I think that this is the advantage of using map over set is. A map will provide a built-in function to get the count of elements inside it (unlike a set). We can use a dictionary anyway. Thanks for your reply, btw
@deepakgaroda975 Жыл бұрын
Nice Explanation
@codewithease-byvarsha Жыл бұрын
Thanks and welcome . Do spread the word with your peers!
@bharanitharan1220 Жыл бұрын
If we want to print the characters of that string how will modify the code
@codewithease-byvarsha Жыл бұрын
Track the ith pointer as startIndex if (map.size() == k && j - i + 1 > maxLen) { maxLen = j - i + 1; startIndex = i; } and use substring method on start & end Index(start+max)
@imPriyansh77 Жыл бұрын
Thanks@@codewithease-byvarsha
@mecies Жыл бұрын
Hey, could you help me understand why is there a while loop on line 35 and not an if statement? Thank you for the video, was very useful. :)
@codewithease-byvarsha Жыл бұрын
The while loop is used to handle cases where the number of unique characters in the current window exceeds the desired value (`k`). It dynamically adjusts the window size by incrementing the `start` index until the map size becomes equal to `k`. This ensures that the resulting substring will have exactly `k` unique characters. Hope this resolves your query.
@mecies Жыл бұрын
@@codewithease-byvarsha Hey, thank you for the reply and the explanation. I thought so too but I couldn't think of a test case that wouldn't work with just the if statement. In case you have one in mind please let me know, thank you anyway. :)
@mckenziepictures7 ай бұрын
TBH, I'm still confused.
@Alok_Roy4 ай бұрын
String s = "abc.b.cc"; find the longest substring length without '.'(dot).....Using java ...ma'am @Code With Ease please provide the code
@udaytewary38092 жыл бұрын
didi please please make a detailed vedio on variable size sliding window it would of great help
@udaytewary38092 жыл бұрын
hlo didi first really thankyou for your great explanation but this code is not able to clear all test case in gfg I have coded in c++
@codewithease-byvarsha2 жыл бұрын
Sure, we will definitely try to create one on sliding window.
@Omneeshkushwah9695 Жыл бұрын
Thanks u for the solution
@codewithease-byvarsha Жыл бұрын
Glad you enjoyed it .Do subscribe & spread the word.