Isomorphic Strings | Simple Thought Process | Leetcode 205| LinkedIn | codestorywithMIK

  Рет қаралды 10,927

codestorywithMIK

codestorywithMIK

Күн бұрын

Пікірлер: 56
@techtalk528
@techtalk528 2 ай бұрын
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-codes
@gui-codes 6 ай бұрын
nice. I also failed the same test case and then figured out the problem.
@rohitrajput2097
@rohitrajput2097 3 ай бұрын
what an amazing expaliation
@NeerajKumar-cj6ky
@NeerajKumar-cj6ky 6 ай бұрын
I subsrcibed your channel 8 month ago and the energy of teaching remains the same.
@oqant0424
@oqant0424 6 ай бұрын
Solved it on my own Came here to learn optimisation Thanks :)
@shloksuman8164
@shloksuman8164 6 ай бұрын
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-ot8uu
@EB-ot8uu 6 ай бұрын
kaafi tricky Problem statement tha. thanks for making it easy
@_FruitBasket
@_FruitBasket 6 ай бұрын
thank you for existing
@shashiraj6226
@shashiraj6226 6 ай бұрын
Sir can you tell me which editor do you use while explaining? It is really very clear explanation. Thank you.
@avendersharma8532
@avendersharma8532 6 ай бұрын
Apple notes hain ipad mein inbuilt hota hain
@soumyadwipsom5014
@soumyadwipsom5014 6 ай бұрын
Thank you sir for sharing your important time with us ❤
@Mohit-fe5hx
@Mohit-fe5hx 6 ай бұрын
november se ye question ko 6 attempt ho gye the wrong submission k..lfinally aaj clear hua
@aritrakar2492
@aritrakar2492 5 ай бұрын
thank you bhaiyaa , corner cases dekhke hi samaj gaya kaha code phassa tha mera .
@wearevacationuncoverers
@wearevacationuncoverers 6 ай бұрын
nice one
@abhijitroy1958
@abhijitroy1958 6 ай бұрын
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
@gaganjasuja1602
@gaganjasuja1602 6 ай бұрын
Can you give a solution using bit manipulation??
@adityaraj-zm7zk
@adityaraj-zm7zk 6 ай бұрын
@ codestorywithMIK bhaiya ye orthogonal greedy algo ka question kaha se kare and pattern of this question
@tutuimam3381
@tutuimam3381 6 ай бұрын
Thanks a lot
@gauravbanerjee2898
@gauravbanerjee2898 6 ай бұрын
Thanks a lot bhaiya ❤❤
@ugcwithaddi
@ugcwithaddi 6 ай бұрын
Thank you ☺️
@Nofaltuguy1
@Nofaltuguy1 6 ай бұрын
i have a doubt will there a problem if length of s and t are different????
@avtarchandra2407
@avtarchandra2407 6 ай бұрын
You are lovely mik ....thanks
@thaman701
@thaman701 6 ай бұрын
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-codes
@gui-codes 6 ай бұрын
thanks
@bipulmukherjee422
@bipulmukherjee422 6 ай бұрын
Thanks
@subhajitdey135
@subhajitdey135 6 ай бұрын
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
@layathal7460
@layathal7460 6 ай бұрын
sir, here we are taking 2 additional maps right? So how the space complexity is still 0(1) ?
@akshay3841
@akshay3841 6 ай бұрын
With 2 additional maps, its O(2 x 1(for limited characters)) so = 0(1).
@wearevacationuncoverers
@wearevacationuncoverers 6 ай бұрын
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-codes
@gui-codes 6 ай бұрын
s and t consist of any valid ascii character.
@harshavshah7929
@harshavshah7929 6 ай бұрын
Bro pls Longest substring with atleast k repeating character ka ek video bana do
@mohdafzal4017
@mohdafzal4017 5 ай бұрын
Why 256 as size ( when both capital and small letters are their ). i could understand 60(65-124). Please tell me
@codestorywithMIK
@codestorywithMIK 5 ай бұрын
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.
@souravjoshi2293
@souravjoshi2293 6 ай бұрын
I was able to solve this 🙂
@tushartyagi4965
@tushartyagi4965 6 ай бұрын
🔥🔥🔥🔥🔥
@kungagyaltsenlachungpa8915
@kungagyaltsenlachungpa8915 6 ай бұрын
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-ot5jr
@HossainAhmedSiam-ot5jr 6 ай бұрын
(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-codes
@gui-codes 6 ай бұрын
@@HossainAhmedSiam-ot5jr thanks bro
@kushagrapandey8898
@kushagrapandey8898 6 ай бұрын
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-codes
@gui-codes 6 ай бұрын
No, because we need something to distinguish that the character I see in the map belongs to s or t
@heathens2867
@heathens2867 Ай бұрын
Yes we can. We just need two if cases
@iamnottech8918
@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; } };
@as2002ajaysingh
@as2002ajaysingh 6 ай бұрын
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
@FifthArima
@FifthArima 6 ай бұрын
man, this question confused the hell out of me.
@dayashankarlakhotia4943
@dayashankarlakhotia4943 6 ай бұрын
class Solution { public void create(char[]arr){ char start='a'; char[]mp=new char[256]; for(int i=0;i
@learningbuddy8575
@learningbuddy8575 6 ай бұрын
What if string s= "abc" and string t="bas"??
@gui-codes
@gui-codes 6 ай бұрын
a -> b b -> a c -> s No same character in s is matched with different characters in t. So it's true.
@dhruvrawat7023
@dhruvrawat7023 6 ай бұрын
class Solution { public: bool isIsomorphic(string s, string t) { int sn = s.size(); int tn = t.size(); if(sn != tn){ return false; } unordered_map mp; vector ta(128, false); for(int i = 0; i < sn; i++){ char sc = s[i]; char tc = t[i]; if(mp.find(sc) == mp.end()){ if(ta[tc] == true){ return false; } mp[sc] = tc; ta[tc] = true; } else{ if(mp[sc] != tc){ return false; } } } return true; } };
@shraban8508
@shraban8508 6 ай бұрын
You haven’t uploaded this map code in github repo rather you have added the same arraylist code twice. Pls modify.
@codestorywithMIK
@codestorywithMIK 6 ай бұрын
Done ❤️
@Algorithmswithsubham
@Algorithmswithsubham 6 ай бұрын
sir yee approach me kya galati haii mapmp1,mp2; int n=s.size(); vectorv(256,1); for(int i=0;i
@devmadaan5146
@devmadaan5146 6 ай бұрын
kyaa haal h bhai ( aap software engineer ban jaun na ...paise chhapo daba ke) khair fir yt mat choddna (LG jayenge fur mere)
@helpmore9389
@helpmore9389 6 ай бұрын
@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.
@_FruitBasket
@_FruitBasket 6 ай бұрын
bhai yeh link toh issi video ka hai
@gui-codes
@gui-codes 6 ай бұрын
link is of this video only
@yashagarwal9784
@yashagarwal9784 6 ай бұрын
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; } };
Isomorphic Strings - Leetcode 205 - Python
10:07
NeetCode
Рет қаралды 80 М.
didn't manage to catch the ball #tiktok
00:19
Анастасия Тарасова
Рет қаралды 31 МЛН
ТИПИЧНОЕ ПОВЕДЕНИЕ МАМЫ
00:21
SIDELNIKOVVV
Рет қаралды 1,4 МЛН
Don't look down on anyone#devil  #lilith  #funny  #shorts
00:12
Devil Lilith
Рет қаралды 45 МЛН
D - I am vengeance | Target DSA Contest - 2
22:24
Learn with Singh
Рет қаралды 49
POTD- 11/11/2023 | Isomorphic Strings| Problem of the Day | GeeksforGeeks
10:09
GeeksforGeeks Practice
Рет қаралды 1,7 М.
205. Isomorphic Strings | Hash Map | Strings
15:35
Aryan Mittal
Рет қаралды 3,5 М.
Master LeetCode 205 with the Best Solution! | Isomorphic Strings
13:39
Engineering Digest
Рет қаралды 2,1 М.
Isomorphic Strings Leetcode Solution
8:28
Pepcoding
Рет қаралды 45 М.
didn't manage to catch the ball #tiktok
00:19
Анастасия Тарасова
Рет қаралды 31 МЛН