Isomorphic Strings | LeetCode problem 205

  Рет қаралды 18,727

Technosage

Technosage

Жыл бұрын

Isomorphic Strings
Leetcode problem number 205
Solution in JAVA
JAVA interview programming playlist:
• Interview Programming ...
Linkedin: / amrita-bala-a2b79460
#java #interviewquestions #leetcode

Пікірлер: 30
@GurjeetSingh-zr7vj
@GurjeetSingh-zr7vj 8 ай бұрын
It is an partial algorithm , The code didn't check condition weather the used char is again used or not, if it is used we do not say the strings are isomorphic. For Resolving - we have to use hashset which contains only those char who used only once. code - class Solution { public boolean isIsomorphic(String s, String t) { HashMap map = new HashMap(); HashSet check = new HashSet(); for(int i=0;i
@nitishkumar-mj9tp
@nitishkumar-mj9tp 3 ай бұрын
@GurjeetSingh-zr7vj ,Your code is small ,but it takes 8-10 minutes for me to understand. Thanks
@saratdas8886
@saratdas8886 8 күн бұрын
the indentation and the brackets opening and closing are not taken care of , and also this code is partially complete , this doesn't pass all test cases
@nitishkumar-mj9tp
@nitishkumar-mj9tp 3 ай бұрын
To the point video, very nice for entry-level experience people(1-2 yr), they don't want everything from basics which takes more time.
@androiddeveloperlpu301
@androiddeveloperlpu301 10 ай бұрын
For those code is not running write the condition of checking length of both the strings is not equal then return false
@amitsgada
@amitsgada Жыл бұрын
Please zoom out the page little bit cannot see the above code lines when explaining or writing code. Keep the zoom in such a way that whole code logic is visible everytime
@TechnosageLearning
@TechnosageLearning Жыл бұрын
Sure..Will take care next time
@MsArn3
@MsArn3 Жыл бұрын
Please soom out, we cant barly see an intire line of code
@amitchaurasia592
@amitchaurasia592 2 ай бұрын
Can you check the below one abcs pqrb
@WHAGDEVARAKONDAVAISHNAVI
@WHAGDEVARAKONDAVAISHNAVI Жыл бұрын
thank you mam.....for your explanation...................
@tufguygaming
@tufguygaming 6 ай бұрын
This is the Code beats 100% users in C++ class Solution { public: bool isIsomorphic(string s, string t) { if(s.size()!=t.size()){ return false; } int hash[256]={0}; // mapping of characters from string s int isMapped[256]={0}; // ensures that mapping goes to which of the word in t for(int i=0;i
@adityamishra1868
@adityamishra1868 3 ай бұрын
explanation is good but they way of writting code is worst, u are placing cbraces before adding if or else
@roopkumar2803
@roopkumar2803 Жыл бұрын
very well explained ma'am
@shindeprem228
@shindeprem228 2 ай бұрын
class Solution { public boolean isIsomorphic(String s, String t) { if(s.length()!=t.length()) return false; HashMap hm = new HashMap(); for(int i=0 ; i
@rishikanth4519
@rishikanth4519 2 ай бұрын
🙏
@kathakalisaha9735
@kathakalisaha9735 Ай бұрын
thanks
@shindeprem228
@shindeprem228 6 күн бұрын
@@rishikanth4519 👍
@shindeprem228
@shindeprem228 6 күн бұрын
@@kathakalisaha9735 👍
@hirahasan
@hirahasan Жыл бұрын
check your solution with "asdvd" and "kkk"
@TechnosageLearning
@TechnosageLearning Жыл бұрын
It is returning false since these strings are not isomorphic strings
@suhasdevang9332
@suhasdevang9332 11 ай бұрын
​@@TechnosageLearninginstead coding in local ide do code in leetcode so that your code not running successfully for all the testcases
@aapkikhushi4689
@aapkikhushi4689 Жыл бұрын
Code ka last mai image dal do atleast
@TechnosageLearning
@TechnosageLearning Жыл бұрын
Git ka url dia hai..Usme sare codes hai..You can try it out..
@androiddeveloperlpu301
@androiddeveloperlpu301 10 ай бұрын
Map m=new HashMap(); int n=s.length(); if(s.length()!=t.length()){ return false; } for(int i=0;i
@sachinpatil1010
@sachinpatil1010 6 ай бұрын
The Above solution seems to be not passing for all the tests.... Please refer below solution , It works s = "foo" t="bar" 1) sToT['f']= b and tToS['b'] = f 2) sToT['o']= a and tToS['a'] = o 3) sToT['o']= a and tChar = r public bool IsIsomorphic(string s, string t) { char[] sTOT = new char[256]; char[] tTOS = new char[256]; for (int i = 0;i< s.Length;i++) { char sChar = s[i]; char tChar = t[i]; if (sTOT[sChar] ==0 && tTOS[tChar] == 0) { sTOT[sChar] = tChar; tTOS[tChar] = sChar; }else if(sTOT[sChar] != tChar) { return false; } } return true; }
@mhirroaceroyportillo875
@mhirroaceroyportillo875 Жыл бұрын
I’m afraid this solution will fail given s = abdc t = abab
@TechnosageLearning
@TechnosageLearning Жыл бұрын
It would return false...since these two strings are not isomorphic .."No two characters may map to same character" But in this case..a-->a and d-->a so it should return false only..
@suhasdevang9332
@suhasdevang9332 11 ай бұрын
​@@TechnosageLearning but your code not running for all the testcase
@pkshriram2530
@pkshriram2530 8 ай бұрын
you are too fast mam, couldn't follow it 🥲
@TechnosageLearning
@TechnosageLearning 8 ай бұрын
Will try to slow the pace in upcoming videos
Дарю Самокат Скейтеру !
00:42
Vlad Samokatchik
Рет қаралды 8 МЛН
Beautiful gymnastics 😍☺️
00:15
Lexa_Merin
Рет қаралды 12 МЛН
Despicable Me Fart Blaster
00:51
_vector_
Рет қаралды 22 МЛН
Isomorphic Strings - Leetcode 205 - Python
10:07
NeetCode
Рет қаралды 71 М.
25 nooby Python habits you need to ditch
9:12
mCoding
Рет қаралды 1,7 МЛН
How Neovim saved me at least 30 minutes today
8:12
Rasmus Bergström
Рет қаралды 11 М.
How I would learn Leetcode if I could start over
18:03
NeetCodeIO
Рет қаралды 351 М.
LeetCode: The Worst Thing to Happen to Software Engineering
8:03
Coding with Dee
Рет қаралды 95 М.
Master LeetCode 205 with the Best Solution! | Isomorphic Strings
13:39
Engineering Digest
Рет қаралды 1,6 М.
Dependency Injection, The Best Pattern
13:16
CodeAesthetic
Рет қаралды 770 М.
Klavye İle Trafik Işığını Yönetmek #shorts
0:18
Osman Kabadayı
Рет қаралды 5 МЛН
ОБСЛУЖИЛИ САМЫЙ ГРЯЗНЫЙ ПК
1:00
VA-PC
Рет қаралды 2,1 МЛН
iPhone, Galaxy или Pixel? 😎
0:16
serg1us
Рет қаралды 606 М.
Я УКРАЛ ТЕЛЕФОН В МИЛАНЕ
9:18
Игорь Линк
Рет қаралды 127 М.