PROBLEM LINK : leetcode.com/problems/minimum... SOLUTION LINK : github.com/niveditaprity/Leet...
Жүктеу.....
Пікірлер: 36
@vivekgupta6696 Жыл бұрын
Explaination so good, Audio Quality and Video Quality also good , Thanks for this !!
@techadorabynivedita
Жыл бұрын
Most welcome!
@gigachad2419 Жыл бұрын
Beautiful Breakdown of Problem and the following Solution 🙏
@techadorabynivedita
Жыл бұрын
Thank you :) must share with your friends
@masumali83569 ай бұрын
lovely explanation...thank you.
@techadorabynivedita
9 ай бұрын
You're most welcome
@kunalsabadra6802 Жыл бұрын
I saw lot off vedios from morning but i was still stuck at concept but your explanation cleared all my doubts along with the code . Thanks a lot keep making such content. Always grateful
@techadorabynivedita
Жыл бұрын
Welcome :) , keep watching and must share with your friends
@tusharnain6652 Жыл бұрын
perfect 👌👌
@techadorabynivedita
Жыл бұрын
Thanks a lot 😊
@shivamtiwari4242 Жыл бұрын
nice dear
@techadorabynivedita
Жыл бұрын
thank you
@AR-py5uk Жыл бұрын
Thank you for the clear explanation
@techadorabynivedita
Жыл бұрын
You are welcome!
@techwithrajdeep7633 Жыл бұрын
Could you please explain how did you reach to the conclusion of using a dfs approach and is this question from graphs?
@techadorabynivedita
Жыл бұрын
its a BFS Approach , while doing mutation one by one i find it is similar to find minimum distance between two nodes if we consider each string as a node , and for finding minimum distance between two nodes we use bfs. because before going to next depth we should check each node of curr depth
@raushankumar6993 Жыл бұрын
thanks again
@techadorabynivedita
Жыл бұрын
Always welcome
@vivekgupta6696 Жыл бұрын
Hi, You can use leetcode formatter extention in chrome for formatting the code
@tusharnain6652
Жыл бұрын
Woah, didnt knew that. Thank bro.
@techadorabynivedita
Жыл бұрын
okay , Thank you :)
@varunshrivastava2706 Жыл бұрын
Great video as always, by the way, can you also provide a solution in python3 since it is easy to understand code irrespective of the coding experience any viewer has? Problems related to graphs and DP C++/Java code could be tough to understand for beginners.
@techadorabynivedita
Жыл бұрын
Thank you :) , will try if you want to contribute, can contribute on github
@itonlineacademy Жыл бұрын
🙂🙂🙂
@rajvardhansingh1000 Жыл бұрын
can u share your linkedin profile ?
@techadorabynivedita
Жыл бұрын
check channel description i provided there
@bhushankorg5606 Жыл бұрын
Solved by Myself! came to see your approach. class Solution { public: bool isValid(string s1, string s2){ int cnt = 0; for (int i = 0; i if(s1[i] != s2[i]) cnt++; } return cnt == 1; } int minMutationUtil(string start, string end, vector &bank){ if(start == end) return 0; int minMut = 1e9; for(int i = 0; i string curr = bank[i]; if(isValid(start, curr)){ bank[i] = "00000000"; int mut = 1 + minMutationUtil(curr, end, bank); bank[i] = curr; minMut = min(minMut, mut); } } return minMut; } int minMutation(string start, string end, vector &bank){ int ans = minMutationUtil(start, end, bank); return (ans == 1e9) ? -1 : ans; } };
@techadorabynivedita
Жыл бұрын
that's great
@yashnarkhedkar3734 Жыл бұрын
but why we use BFS here.. I can't getting where to use BFS, DFS..please tell
@techadorabynivedita
Жыл бұрын
its a BFS Approach , while doing mutation one by one i find it is similar to find minimum distance between two nodes if we consider each string as a node , and for finding minimum distance between two nodes we use bfs. because before going to next depth we should check each node of curr depth
@yashnarkhedkar3734
Жыл бұрын
@@techadorabynivedita yes nivedita its clear i saw another videos on youtube.. From that i get idea how to use BFS DFS
Пікірлер: 36
Explaination so good, Audio Quality and Video Quality also good , Thanks for this !!
@techadorabynivedita
Жыл бұрын
Most welcome!
Beautiful Breakdown of Problem and the following Solution 🙏
@techadorabynivedita
Жыл бұрын
Thank you :) must share with your friends
lovely explanation...thank you.
@techadorabynivedita
9 ай бұрын
You're most welcome
I saw lot off vedios from morning but i was still stuck at concept but your explanation cleared all my doubts along with the code . Thanks a lot keep making such content. Always grateful
@techadorabynivedita
Жыл бұрын
Welcome :) , keep watching and must share with your friends
perfect 👌👌
@techadorabynivedita
Жыл бұрын
Thanks a lot 😊
nice dear
@techadorabynivedita
Жыл бұрын
thank you
Thank you for the clear explanation
@techadorabynivedita
Жыл бұрын
You are welcome!
Could you please explain how did you reach to the conclusion of using a dfs approach and is this question from graphs?
@techadorabynivedita
Жыл бұрын
its a BFS Approach , while doing mutation one by one i find it is similar to find minimum distance between two nodes if we consider each string as a node , and for finding minimum distance between two nodes we use bfs. because before going to next depth we should check each node of curr depth
thanks again
@techadorabynivedita
Жыл бұрын
Always welcome
Hi, You can use leetcode formatter extention in chrome for formatting the code
@tusharnain6652
Жыл бұрын
Woah, didnt knew that. Thank bro.
@techadorabynivedita
Жыл бұрын
okay , Thank you :)
Great video as always, by the way, can you also provide a solution in python3 since it is easy to understand code irrespective of the coding experience any viewer has? Problems related to graphs and DP C++/Java code could be tough to understand for beginners.
@techadorabynivedita
Жыл бұрын
Thank you :) , will try if you want to contribute, can contribute on github
🙂🙂🙂
can u share your linkedin profile ?
@techadorabynivedita
Жыл бұрын
check channel description i provided there
Solved by Myself! came to see your approach. class Solution { public: bool isValid(string s1, string s2){ int cnt = 0; for (int i = 0; i if(s1[i] != s2[i]) cnt++; } return cnt == 1; } int minMutationUtil(string start, string end, vector &bank){ if(start == end) return 0; int minMut = 1e9; for(int i = 0; i string curr = bank[i]; if(isValid(start, curr)){ bank[i] = "00000000"; int mut = 1 + minMutationUtil(curr, end, bank); bank[i] = curr; minMut = min(minMut, mut); } } return minMut; } int minMutation(string start, string end, vector &bank){ int ans = minMutationUtil(start, end, bank); return (ans == 1e9) ? -1 : ans; } };
@techadorabynivedita
Жыл бұрын
that's great
but why we use BFS here.. I can't getting where to use BFS, DFS..please tell
@techadorabynivedita
Жыл бұрын
its a BFS Approach , while doing mutation one by one i find it is similar to find minimum distance between two nodes if we consider each string as a node , and for finding minimum distance between two nodes we use bfs. because before going to next depth we should check each node of curr depth
@yashnarkhedkar3734
Жыл бұрын
@@techadorabynivedita yes nivedita its clear i saw another videos on youtube.. From that i get idea how to use BFS DFS
Detailed code : github.com/utkarsh006/BFS/blob/main/433.%20Minimum%20Genetic%20Mutation.cpp
@techadorabynivedita
Жыл бұрын
thank you
What is the use of minimum in this Question?
@techadorabynivedita
Жыл бұрын
we can get multiple way to reach "end" string , but ans should be minimum
@MR-re8pq
Жыл бұрын
Thanks 👍