I like the trick you did with the char's to initialize the phash and shash map. I don't come from CS background so was unaware of the implicit conversion to int when doing char arithmetic - you used this to place the correct char in the relevant slot in the hash (vector). Then you get constant look up time. After I looked up char arithmetic and played around with it, now makes complete sense to me. That's what I like about C S - always something to learn ☺️
Code C++:
if(s.size()
//Brute Force: Use 2 loops or substring concept
//TC: O(n⋅klogk); SC:O(n+k)
class Solution {
public:
vector findAnagrams(string s, string p) {
int n=s.length();
int k=p.length();
sort(p.begin(),p.end());
vectorans;
for(int i=0;i
Great Explanation. I Like the way you explain the problem in simple way👏.
I like the trick you did with the char's to initialize the phash and shash map. I don't come from CS background so was unaware of the implicit conversion to int when doing char arithmetic - you used this to place the correct char in the relevant slot in the hash (vector). Then you get constant look up time. After I looked up char arithmetic and played around with it, now makes complete sense to me. That's what I like about C S - always something to learn ☺️
Great previously I had confusion with this one.
Great explanation ! 💯💯
Keep uploading daily leetcode solutions like this please
Please upload a video on the problem given below🙏🙏
424. Longest Repeating Character Replacement
nice solution
thankyou so much ma'am
Way of approch u solve all the problems its very nice ... It's very simple & easy to understand ..
#NITRR
Thank you!!
which keyboard you use ma'am? sound is really cool :)
Tons of thanks ++
Nice
Same like you i see in iit bombay.
Can you please suggest any good resources to learn graph?
On youtube: Freecodecamp and Abdul Bari , On Udemy: Inside Code, through articles: Geeksforgeeks
@@probabilitycodingisfunis1 Ohk thankss..
Can you please suggest any good resources to learn graph and Dynamic programming?
Geeksforgeeks, Inside Code on Udemy, Abdul Bari on UA-cam
@@probabilitycodingisfunis1 Thank You mam👍