bestest explanation of question and the code. I mean seriously I don't comment on any youtuber video, I learn from striver and other youtubers video as well but still didn't find this good explanation. huge respect to you buddy. just subscribed. thanks a lot brother......
@gui-codes6 ай бұрын
nice. I also failed the same test case and then figured out the problem.
@rohitrajput20973 ай бұрын
what an amazing expaliation
@NeerajKumar-cj6ky6 ай бұрын
I subsrcibed your channel 8 month ago and the energy of teaching remains the same.
@oqant04246 ай бұрын
Solved it on my own Came here to learn optimisation Thanks :)
@shloksuman81646 ай бұрын
even i tried using map, and mapped the frequency of both the strings. Then iterated over a string to to check any mismatch in frequency. passed 43/45 testcases. got stuck at the preserving order point , which was i guess the crux of the problem. thanks for solution
@EB-ot8uu6 ай бұрын
kaafi tricky Problem statement tha. thanks for making it easy
@_FruitBasket6 ай бұрын
thank you for existing
@shashiraj62266 ай бұрын
Sir can you tell me which editor do you use while explaining? It is really very clear explanation. Thank you.
@avendersharma85326 ай бұрын
Apple notes hain ipad mein inbuilt hota hain
@soumyadwipsom50146 ай бұрын
Thank you sir for sharing your important time with us ❤
@Mohit-fe5hx6 ай бұрын
november se ye question ko 6 attempt ho gye the wrong submission k..lfinally aaj clear hua
@aritrakar24925 ай бұрын
thank you bhaiyaa , corner cases dekhke hi samaj gaya kaha code phassa tha mera .
@wearevacationuncoverers6 ай бұрын
nice one
@abhijitroy19586 ай бұрын
can we use the find function in such a way that when we are searching for the first string element we can also check if the associated elements with it also exists or not
@gaganjasuja16026 ай бұрын
Can you give a solution using bit manipulation??
@adityaraj-zm7zk6 ай бұрын
@ codestorywithMIK bhaiya ye orthogonal greedy algo ka question kaha se kare and pattern of this question
@tutuimam33816 ай бұрын
Thanks a lot
@gauravbanerjee28986 ай бұрын
Thanks a lot bhaiya ❤❤
@ugcwithaddi6 ай бұрын
Thank you ☺️
@Nofaltuguy16 ай бұрын
i have a doubt will there a problem if length of s and t are different????
@avtarchandra24076 ай бұрын
You are lovely mik ....thanks
@thaman7016 ай бұрын
Java code guyz... class Solution { public boolean isIsomorphic(String s, String t) { int n=s.length(); int m=t.length(); if(n!=m) return false; HashMap mp=new HashMap(); for(int i=0;i
@gui-codes6 ай бұрын
thanks
@bipulmukherjee4226 ай бұрын
Thanks
@subhajitdey1356 ай бұрын
Another approach but same space and time complexity :) bool f(string s,string t){ int size1=s.size(),size2=t.size(); if(s==t) return true; unordered_mapmp; unordered_maptaken; for(int i=0;i
@layathal74606 ай бұрын
sir, here we are taking 2 additional maps right? So how the space complexity is still 0(1) ?
@akshay38416 ай бұрын
With 2 additional maps, its O(2 x 1(for limited characters)) so = 0(1).
@wearevacationuncoverers6 ай бұрын
Because the constraints says that there will be only valid ascii characters in the string. We have only 256 ASCII characters. so map size will never exceed 256. Hence constant.
@gui-codes6 ай бұрын
s and t consist of any valid ascii character.
@harshavshah79296 ай бұрын
Bro pls Longest substring with atleast k repeating character ka ek video bana do
@mohdafzal40175 ай бұрын
Why 256 as size ( when both capital and small letters are their ). i could understand 60(65-124). Please tell me
@codestorywithMIK5 ай бұрын
In ASCII, for example, there are 128 characters, but if you include extended ASCII, there are 256 characters. This includes both uppercase and lowercase letters, digits, punctuation marks, and control characters. So, to ensure that you can handle both lowercase and uppercase letters, you might use an array size of 256 to cover all possibilities.
@souravjoshi22936 ай бұрын
I was able to solve this 🙂
@tushartyagi49656 ай бұрын
🔥🔥🔥🔥🔥
@kungagyaltsenlachungpa89156 ай бұрын
s = "paper", t = "title", 'e' is alreday mapped with ''l' and and 'r' is mapped with 'e'? 2 different character mapped with same character?
@HossainAhmedSiam-ot5jr6 ай бұрын
(e->L ) making pair in hash1. (L->e) making pair in hash2. now (r->e) making pair in hash1 and (e->r) in hash2. are you noticed that, "e" not appear in hash2 before, where you adding now . "e" as a key existing in different hash hash1 hash2 e-->L L-->e r-->e e-->r
@gui-codes6 ай бұрын
@@HossainAhmedSiam-ot5jr thanks bro
@kushagrapandey88986 ай бұрын
10:22 kya hum ek hi map me value ke through key ko ni check kr skte? Jaise key se value check kr rhe? 🤔
@gui-codes6 ай бұрын
No, because we need something to distinguish that the character I see in the map belongs to s or t
@heathens2867Ай бұрын
Yes we can. We just need two if cases
@iamnottech8918Ай бұрын
using 1 map class Solution { public: bool isIsomorphic(string s, string t) { unordered_map mpp; // length same given int i = 0; while (i < s.length()) { if (mpp.find(s[i]) == mpp.end()) // not there { for (const auto& pair : mpp) { // as actual mapp is {key ,val} pair if (pair.second == t[i]) { return false; } } mpp[s[i]] = t[i]; } else if (mpp.find(s[i]) != mpp.end()) // there { // if already presmt and now we got different val if (mpp[s[i]] != t[i]) // value was not as expected then not isomorphic return false; } i++; } return true; } };
@as2002ajaysingh6 ай бұрын
if some one want a simple solution with not many condition are - class Solution { public: bool isIsomorphic(string s, string t) { vectormark(257,false); vectorc(257,' '); for(int i = 0;i
@FifthArima6 ай бұрын
man, this question confused the hell out of me.
@dayashankarlakhotia49436 ай бұрын
class Solution { public void create(char[]arr){ char start='a'; char[]mp=new char[256]; for(int i=0;i
@learningbuddy85756 ай бұрын
What if string s= "abc" and string t="bas"??
@gui-codes6 ай бұрын
a -> b b -> a c -> s No same character in s is matched with different characters in t. So it's true.
You haven’t uploaded this map code in github repo rather you have added the same arraylist code twice. Pls modify.
@codestorywithMIK6 ай бұрын
Done ❤️
@Algorithmswithsubham6 ай бұрын
sir yee approach me kya galati haii mapmp1,mp2; int n=s.size(); vectorv(256,1); for(int i=0;i
@devmadaan51466 ай бұрын
kyaa haal h bhai ( aap software engineer ban jaun na ...paise chhapo daba ke) khair fir yt mat choddna (LG jayenge fur mere)
@helpmore93896 ай бұрын
@codestorywithMIK #codestorywithMIK Thank you bhaiya to make difficult question, easy. Would you please make the video for this question kzbin.info/www/bejne/aHq2f3Z6f6qap7M As the solutions available for this is very less, and also complicated. Hope to get the solution for this question soon. Thank you so much for giving time to read this and think about it.
@_FruitBasket6 ай бұрын
bhai yeh link toh issi video ka hai
@gui-codes6 ай бұрын
link is of this video only
@yashagarwal97846 ай бұрын
Important Substitue: I think we can Replace Map2 with unordered_set. It can work. Here is the updated code: class Solution { public: bool isIsomorphic(string s, string t) { int n = s.size(); unordered_map mp; unordered_set mapped; for (int i = 0; i < n; i++) { if (mp.find(s[i]) == mp.end()) { if (mapped.find(t[i]) != mapped.end()) return false; mp[s[i]] = t[i]; mapped.insert(t[i]); } else { if (mp[s[i]] != t[i]) return false; } } return true; } };