In the realm of code and algorithms, we find, A teacher, Mike, with knowledge vast, combined. On this Teacher's Day, we celebrate his grace, As he guides us through the digital maze. He breaks down complexities with such ease, Inspiring us all, putting our minds at ease. On this special day, we send our praise, To Codestory's captain, in many ways. Happy teachers day brother 🙇♀🙇♀
@codestorywithMIK Жыл бұрын
You made my day. Thank you so much 🙏🙏🙏❤️❤️
@sharaabsingh9 ай бұрын
Yaar aap gajab insaan ho... Harr question itna simple kr doge toh interviewer kaha se question puchega? Galat baat hai sir ji, aise toh sab FAANG ke interviews nikaal lenge😆 Thank you yaar, bohot shaandaar explanation!!
@Tech_insider168Ай бұрын
I am visiting this channel for the first time. after seeing this video I have become a subscriber because sir, your explanation is very good i understand each and every line ❤️
@Greek_Bit_10 Жыл бұрын
bhai aap ke jaise koi nhi explain karta hai Aap crysatl clear kar dete ho concept ko thanks bro ❤
@codestorywithMIK Жыл бұрын
Means a lot ❤️
@kareni75724 ай бұрын
Nice. Thanks for building intuition in both approaches! Makes it enjoyable 🎉
@harshikaagarwal6628 Жыл бұрын
I don't have words to express my gratitude to you. The impact you have made by your teachings is immense. Thanks for all the confidence and knowledge you have given. :)
@GouravSharma-tv2pi7 ай бұрын
Whenever i stuck at problem , i directly came here 🤩🤩
@shreyyyc Жыл бұрын
Wish you a very happy teacher's day bhai. You're are the best teacher that's even being virtual. It's been 8 months I have been watching your daily videos and It always feels like ki mera bda bhai merko pdha rha h. Without a doubt your explanations are the best but your videos also delivers the ASMR experience, No loudness, relaxing voice, complex algorithms made easy and sometimes the tickling voice of your pen touching your Ipad screen. A good coding and ASMR experience altogether. Happy teacher's day!
@mdtouseeb264 Жыл бұрын
Ek number bro😊.....floor-->ceil☺
@bossmemes3308 Жыл бұрын
I am really happy today to see improvements in myself. I have tried from scratch to solve this problem along with this problem I've solved the questions like how to clone single LL, then doubly LL and tried myself to solve it but failed because I was creating a new node for the random pointer. This video shown to me and I start to watch I have seen the concept of how the random pointer should work and I tried one more time before watching the video and literally I did it. Thankyou so much mike. :)
@codestorywithMIK Жыл бұрын
I am so so happy to hear that ❤️❤️❤️
@bossmemes3308 Жыл бұрын
🙏❤️
@amitguptapc Жыл бұрын
2nd approach was just superb. And very well explained
@codestorywithMIK Жыл бұрын
Thank you 🙏🙏😇❤️
@035-harshitsingh7 Жыл бұрын
Happy Teacher's day bhaiya...aapke karan hi jo knowledge hai so hai bhaiya aap nhi hote to bhut cheejon me clarity nhi aati...Kudos to your hardwork and consistency ✨🎉
@aayushranjan5572 Жыл бұрын
bhaiya apse bahut kuch sikhn ko milta h pls daily 3,4 vdo daley
@codestorywithMIK Жыл бұрын
Sure. Will definitely try 🙏😇
@AAKIBVAHORA-ty4mk6 ай бұрын
Appreciate the way you explain each detail with enthusiasm. I really admire you ;)
@chaitanya812 Жыл бұрын
abhi tk is question ko mai sabse tough smjta tha but ab nai thanks for your effort bhai
@codestorywithMIK Жыл бұрын
So glad to hear that ❤️🙏😇
@umeshbisht1054 Жыл бұрын
Happy teacher's day bhaiya and thanku for the second apporch ❤❤
@muntajir6464 ай бұрын
Best Explanation on the internet💌 Thank you so much.
@monikavaid50835 ай бұрын
The way you explained the space complexity is really good 😇
@codestorywithMIK5 ай бұрын
Glad it helped 😇
@krishankant3720 Жыл бұрын
It's been our pleasure to learn from u everyday ,happy teachers day 🎉🎉❤❤
@keertilata20 Жыл бұрын
Happy Teachers Day, bhaiya... I hope everyone gets a teacher like you.
@avnish-wf8rv Жыл бұрын
Happy Teachers Day, you gave us confidence in DS and made DS easier for us. Thanks a lot 🎉❤
@saurabhtiwari9614 Жыл бұрын
So beautiful explanation sir. Clear and cut explanation. N happy teacher's day to u sir🎉🎉🎉.
@souravjoshi2293 Жыл бұрын
Happy Teachers' Sir ji
@monty6393 Жыл бұрын
Hey brother!. Thanks for the video , the second approach was the key take away from the video ..
@kunaljoshi9262 Жыл бұрын
Happy teachers day to our ultimate guru Mike Sir........😊
@floatingpoint7629 Жыл бұрын
thanks for the explanation. this is how i did it: var copyRandomList = function (head) { if (!head) return null const map = new Map(); map.set(null, null); const dfs = node => { if (map.has(node)) return map.get(node); const newNode = new Node(node.val); map.set(node, newNode); newNode.next = dfs(node.next); newNode.random = dfs(node.random); return newNode; } return dfs(head); } another approach: var copyRandomList = function (head) { if (!head) return null; let ptr = head; while (ptr) { const newNode = new Node(ptr.val); ptr.clone = newNode; ptr = ptr.next; } ptr = head; const newHead = ptr.clone; while (ptr) { ptr.clone.random = ptr.random?.clone ? ptr.random.clone : null; ptr.clone.next = ptr.next?.clone ? ptr.next.clone : null ptr = ptr.next; } ptr = head; while(ptr) { delete ptr.clone; ptr = ptr.next; } return newHead; }
@codestorywithMIK Жыл бұрын
Thanks a lot for sharing ❤️
@ishwarkoki1119 Жыл бұрын
Happy teacher's Day MIK. Hopefully will meet someday
@aws_handles8 ай бұрын
Best explanation on this problem
@r.beditz3674 Жыл бұрын
Happy teacher's day bhaiya ❤🙏🏻 aapke bina meri DSA achi hi nahi hoti. all thanks to you🙌🏻
@codestorywithMIK Жыл бұрын
It’s all your hard work 💪🙏❤️
@ajit287 Жыл бұрын
Nice Explanation !!! Especially for space part really loved it bro.... Happy teacher's Day.
@phoddaal7130 Жыл бұрын
Happy Teacher’s Day Sir 😇 Thank you so much for putting so much efforts in your videos to help us. ❤️
@Tejaswi-xd4re Жыл бұрын
Happy teacher's day sir.. After u feel better pls make the question list video sir which I was asking earlier
@daayush6654 Жыл бұрын
I think technical term "Auxiliary space" use karte hai log, like what extra space apart from space taken by output is used by our approach. Which for first approach is O(n) and O(1) for second approach. But overall space complexity for both approaches would be O(n) based on the definition you explained
@codestorywithMIK Жыл бұрын
Definitely. Actually it’s totally debatable. Whatever interviewer agrees for 😇
@2Deadly_ Жыл бұрын
Happy Teacher Day sir, You are such a great teacher. Making hard problems simple and easy to understand
@gauravbanerjee289810 ай бұрын
Best explanation fr this question on the internet ❣🔥🔥
@codestorywithMIK10 ай бұрын
It means a lot. Thank you so much ❤️❤️
@mdfaizanraza3509 Жыл бұрын
Happy teacher's day Mazhar bhaijaan❤...aapko khabar nahi par aap ek video me bohot kuch seekha jate ho❤
@codestorywithMIK Жыл бұрын
Means a lot ❤️🙏😇 Thank you ❤️❤️
@aman3210 Жыл бұрын
HAPPY TEACHER'S DAY BHAIYA ...LOVE YOUR TRUE & EASY EXPLAINATION ... THANKS++;
@086-jatinsharma8 Жыл бұрын
Happy teacher's day sir..
@turing_machine544 Жыл бұрын
Happy Teachers day mik bhaiya, Thanks for existing , in the word full of wannabe dsa influencers , you are the only one who cares about your students. I admire you a lot , I was very confused last year about my dsa preparation and have no idea what to do , how to do and lack of motivation. Then accidentally i watched your yt video and it was one of my best decision ever. I can't really express how mu h i admire you. Once i will get the job i will come to meet you.❤❤❤
@mehulsharma1292 Жыл бұрын
Happy teacher's day sir 🙌
@abby_bytes Жыл бұрын
Happy Teachers Day MIK Guruji!
@nothingtolose682 Жыл бұрын
happy teachers day mik bhai... love your content
@Mainak908 Жыл бұрын
Happy teacher's day bhaiya❤❤❤🎉🎉🎉
@tutuimam3381 Жыл бұрын
Happy teachers day
@Music-tp8gg Жыл бұрын
Happy teachers day guruji
@it-27arpit99 Жыл бұрын
Happy teacher's day ❤
@ShivamKumar-zj8bp Жыл бұрын
Happy Teacher's Day Bhaiya. Thank you so much for giving the push though your awesome explanation. ❤
@codestorywithMIK Жыл бұрын
Thank you ❤️🙏😇
@pabitrakb5291 Жыл бұрын
Happy teacher's day
@amanashishlakra9479 Жыл бұрын
Happy Teacher day Bhaiya😃😃!! 🙏🙏🙏🙏
@jyotishmoydeka6804 Жыл бұрын
Happy teacher's day bhaiya❤🔥❤🔥.I just can't express how much I am grateful to you. Btw my first ever research paper is published successfully yesterday😇. I am so happyyy.
@codestorywithMIK Жыл бұрын
Wow. Congratulations ❤️💪💪 And thank you for your warm wishes ❤️❤️
@jyotishmoydeka6804 Жыл бұрын
@@codestorywithMIK thank you bhaiya 🥰
@abhishekverma760411 ай бұрын
simillar question : Clone Graph.. Both have similarities , u have to hash the values before marking down the next connected node.
@abhaytiwari5991 Жыл бұрын
Happy Teacher's day🎉 Mik bhai
@percyx29 Жыл бұрын
Happy Teacher's Day my Hero !
@HarshMishra-cp7tj Жыл бұрын
10K Soon Bhhaiya And Happy Teacher's Day
@codestorywithMIK Жыл бұрын
Thank you so much 😀
@prabhkiratsingh8490 Жыл бұрын
Happy Teacher's Day Sir❤✨
@killshot57 Жыл бұрын
Happy teacher's day sir ❤️❤️❤️
@yashsaxena326 Жыл бұрын
happy teachers day sir.
@footballcreativeeverywhere260 Жыл бұрын
Happy teacher's day Bhiya ❤️
@rajeevkumarsingh8719 Жыл бұрын
happy teacher's day bhaiya
@YashSinghal Жыл бұрын
thanks for making videos !!
@wearevacationuncoverers Жыл бұрын
Happy Teachers' Day LEGEND
@Aditrash-n5j Жыл бұрын
Happy teachers day sir !!!
@bhartipatel7833 Жыл бұрын
Happy teacher's day bhaia 🎉😊 Hope you're well.
@doomhead9109 Жыл бұрын
I am late but Happy Teachers Day sir ❤❤
@cse080chandrasekhar9 Жыл бұрын
happy teachers day sir
@thekindspill Жыл бұрын
Happy Teachers' Day SIR
@shivam875S10 ай бұрын
crystal clear sir
@codestorywithMIK10 ай бұрын
😇❤️🙏
@manaskhare412 Жыл бұрын
You're doing great work, hatsoff to you! It would be great, if you could add the link of the IPad notes. It would be easy for us, if we want revision in the future.
@codestorywithMIK Жыл бұрын
Hello Manas, Sure thing. I will add ipad notes link too.
@manaskhare412 Жыл бұрын
@@codestorywithMIK thanks 😊
@AnandKumar-kz3ls Жыл бұрын
i think space complexity should be O(N) but if interviewer said you have to build it without using any data structure like map , sets then this will be the optimal and best approch
@codestorywithMIK Жыл бұрын
Indeed ❤️❤️
@Lucifer0872 Жыл бұрын
Happy teachers day bhaiya
@anuppatankar4294 Жыл бұрын
Happy Teachers Day 🤝
@Rajdweep Жыл бұрын
happy teachers' day bro❤❤
@dayashankarlakhotia4943 Жыл бұрын
Happy teachers day .for your guidance I wrote this code. public class solution { public Node copy Random List(Node head){ if(head ==null)return null; Hash map mpp=new Hash map (); Node cur=head; while (cur!=null){ mp.put (cur,new Node (cur. val)); cur=cur.next; } cur=head; while (cur!=null){ mpp.get (cur).next =mpp.get(cur. next); mpp.get (cur).random =mpp.get (cur. random); cur=cur. next; } return mpp.get(head); } }; 2nd approach. Public class solution { public Node copy Random List(Node head){ if(head ==null)return null; Node cur =head; while (cur!=null){ Node. new. node=new Node (cur.val,cur.next); cur.next =new. node; cur=new. node.next; } cur =head; while (cur!=null){ if(cur. random!=null){ cur.next. random =cur. random. next; } cur =cur. next!=null? cur. next. next:null; } Node. old_ head =head; Node. new _head =head. next; Node. prev=old_head; Node. cur =new _head; while (prev!=null){ prev. next =prev. next. next; cur.next =cur.next.next !=null?cur. next. next:null; prev =prev. next; cur=cur.next; } return new _head; } }; thanks 🎉❤😮
@Samtoosoon3 ай бұрын
8:35
@nagmakhan672 Жыл бұрын
Happy Teacher’s Day ❤
@TheBusaSinger Жыл бұрын
Happy Teacher’s Day! 😇
@ugcwithaddi Жыл бұрын
Happy Teachers’ Day ❤
@codeandtalk6 Жыл бұрын
❤❤
@codeofcoffee8722 Жыл бұрын
👌🏼
@taneyasoni Жыл бұрын
5/30
@deepjyotidas37 Жыл бұрын
Bhaiya I want to know your intuition building ,if you get a random question which is not seen previously, and also if you can't figure out how to solve it after giving a lot of time ,What is your approach after that to find the solution?
@AlishaKhan-ww3io Жыл бұрын
legend
@cacklouncle Жыл бұрын
Pehle approach mein extra space kaise hua woh create toh ek baar hi kiya hai, chahe result mein use karen ya map mn rakhen
@codestorywithMIK Жыл бұрын
In the first approach, we used map to store the nodes. That’s O(n) extra space we used
@abhishekverma760411 ай бұрын
but data is crucial part of software development,in second approach we are tampering data,is it correct to do so...
@codestorywithMIK11 ай бұрын
I totally agree with you Abhishek. Actually it totally depends on what the interviewer wants from you. If they deliberately want you to solve that way (they are fine with data tampering) then you can go ahead with 2nd approach
@39_jatinjain4 Жыл бұрын
Que-Jump game class Solution { public: bool sol(int idx,vector& nums,int n,vector&dp){ // base case if(idx==n-1) return true; if(idx>=n) return false; if(dp[idx]!=-1) return dp[idx]; bool ans=false; for(int i=1;i
@percyx29 Жыл бұрын
Sir face reveal when? hehe
@codestorywithMIK Жыл бұрын
Waiting for Ted Talk invitation 😉
@AbhishekGupta-ej3vw Жыл бұрын
Happy teachers day @ codewithmik
@jagadeeshp1163 Жыл бұрын
""" # Definition for a Node. class Node: def __init__(self, x: int, next: 'Node' = None, random: 'Node' = None): self.val = int(x) self.next = next self.random = random """ class Solution: def copyRandomList(self, head: 'Optional[Node]') -> 'Optional[Node]': # add new node thead=head curr=head while(thead): new_node=Node(thead.val) thead=thead.next curr.next=new_node new_node.next=thead curr=thead # random pointer work thead=head while(thead and thead.next): if thead.random==None: thead.next.random=None else: thead.next.random=thead.random.next thead=thead.next.next #break to 2 ll new_head=head.next temp1=new_head while(head and temp1): if head.next==None: head.next=None else: head.next=head.next.next if temp1.next==None: temp1.next=None else: temp1.next=temp1.next.next return new_head TLE i code is giving TLE because of infinte while loop Can someone help me finding the error