Aap itna acha teach karte ho ki repeat dekhta hu question already karne ke baad bhi raretalent.🙇🙇
@codestorywithMIK Жыл бұрын
Thank you so much Ankit ❤️
@amitshankhwar2542 Жыл бұрын
Soo true ..
@codestorywithMIK Жыл бұрын
Apologies for the delay today guys. Have been travelling this weekend. Hope you guys will understand ❤❤❤
@UECAshutoshKumar7 ай бұрын
Thank you 😊
@anuppatankar4294 Жыл бұрын
By seeing your video today I was able to code it myself. Your daily uploads are really helpful for improving my skills. Keep up the great work! 👍🏻
@codestorywithMIK Жыл бұрын
Thanks a lot ❤
@molyoxide8358 Жыл бұрын
In the morning, I saw today's problem & left it(too lazy), but after this video removed my laziness & I went forward to solve this challenge. Thanks again for your guidance.
Amazing Explanation brother was literally waiting for your video
@codestorywithMIK Жыл бұрын
Thank you so much Sajan
@wearevacationuncoverers Жыл бұрын
One of the finest explanations on this.
@shikharpandya49274 ай бұрын
Anyone who wants to practise dsa like listening a story this is the guy u should follow :)
@souravjoshi2293 Жыл бұрын
Thanks for working for us during weekends also bro. Respect hai tumhare lie
@rajgupta5355 Жыл бұрын
Bhaiya this is superb....
@tutuimam3381 Жыл бұрын
Thanks a lot
@anshumantripathy115 Жыл бұрын
At 5:50 , when "BrowserHistory" is called the current is initialized and the url is also added to the back stack. So, the top of the stack is actually the value of current. Later also the same thing is done in the story, the top of the back stack is the value of current but in the code you have done different.
@anshumantripathy115 Жыл бұрын
A/c to the story this should be the code, but I am getting error class BrowserHistory { public: stack past; stack future; string current; BrowserHistory(string homepage) { current = homepage; past.push(homepage); } void visit(string url) { future = stack(); past.push(url); current = url; } string back(int steps) { while (steps > 0 && !past.empty()) { future.push(current); past.pop(); current = past.top(); steps--; } return current; } string forward(int steps) { while (steps > 0 && !future.empty()) { past.push(future.top()); future.pop(); current = past.top(); steps--; } return current; } };
@@vedantdeshmukh1778 There are some corner cases which needs to be checked. Check the new code I shared. This one works, but it becomes a bit complex using this approach rather we should follow the code shared by MIK.
@codestorywithMIK Жыл бұрын
You are right Anshuman. Missed to cover corner cases in explanation. Thank you so much for pointing this out
@Aditrash-n5j Жыл бұрын
Instead of using "curr" you can use "peek" of stack to return values, like this class BrowserHistory { Stack backward; Stack forward; public BrowserHistory(String homepage) { backward = new Stack(); forward = new Stack(); backward.push(homepage); } public void visit(String url) { // Clear forward while(!forward.isEmpty()) forward.pop(); backward.push(url); } public String back(int steps) { // Pop from backward into forward while(backward.size() != 1 && steps != 0){ forward.push(backward.pop()); steps--; } return backward.peek(); } public String forward(int steps) { // Pop form forward into backword while(!forward.isEmpty() && steps != 0){ backward.push(forward.pop()); steps--; } return backward.peek(); } }
@molyoxide8358 Жыл бұрын
Yeah It's Sunday tomorrow we need 2 other approaches too. A Humble request from a Coder to Coder🥰 And also if you're free please shed some light on leetcode - 1019 as I requested in the previous video.
@codestorywithMIK Жыл бұрын
Sure. Travelling this weekend. Will make for sure next week
@rajgupta5355 Жыл бұрын
Bhaiya other 2 approaches k liye please video bnaiyega
@Imrockonn Жыл бұрын
❤
@KishanSingh-vc3re4 ай бұрын
Do they ask such questions in Dsa rounds or only in system design interviews
@waghakshay54010 ай бұрын
sir canyou please make a dryrun video for this code..I have some confusion
@sonalipatro2087 Жыл бұрын
please make video on other two approaches as well
@codestorywithMIK Жыл бұрын
Sure. Travelling this weekend. Will make for sure next week
@Ramneet04 Жыл бұрын
I waa able to code with two stack approach, hey well dlubly ll is more optimise???
@aryanvashishtha0001 Жыл бұрын
Bro explaination is Top-notch but pls try to improve the quatlity of video if possible....
@codestorywithMIK Жыл бұрын
Actually the quality will improve after a while as it takes some time to upload full quality from KZbin And thank you so much for your kind words ❤❤❤
@udaykumarchetla6205 Жыл бұрын
Bro can u upload videos for today's contest last 2 problems?
@souravjoshi2293 Жыл бұрын
Waiting for today's Leetcode
@codestorywithMIK Жыл бұрын
Being uploaded
@YashSinghal Жыл бұрын
daab diya 😅😆
@hirenjoshi6073 Жыл бұрын
Hi Bro! Make it using Doubly Linked List
@swapnilnangare5805 Жыл бұрын
Mazhar bhai ek baar word break bhi samaza do pls. Trie ke saath dp samazne ke liye hard ja rahi hain. lots of love.
@codestorywithMIK Жыл бұрын
That’s a wonderful Qn swapnil. Noted. Let me cover that too. Thanks again for pointing
@omkarjadhav8489 ай бұрын
Bhaiya using doubly linked list bhi samza dena please
@whodatsaken3 ай бұрын
great explanation bro. loved it for those who want DLL implementation class BrowserHistory { public: struct ListNode{ string data; ListNode* prev; ListNode* next; ListNode(string x){ data=x; prev=nullptr; next=nullptr; } }; ListNode* head=nullptr; BrowserHistory(string homepage) { head=new ListNode(homepage); } void visit(string url) { ListNode* temp=new ListNode(url); temp->prev=head; head->next=temp; head=head->next; } string back(int steps) { while(head->prev!=nullptr and steps){ head=head->prev; steps--; } return head->data; } string forward(int steps) { while(head->next!=nullptr and steps){ head=head->next; steps--; } return head->data; } };
@Babu_Vishaal Жыл бұрын
bro ...! ho sake to job opening ke update bta diya kro.
@codestorywithMIK Жыл бұрын
Sure Vishal
@aadityabuchale15 Жыл бұрын
Bhiya bohot late kr diya.. its okay i know you might be in any work.. btw thanks for the video..
@codestorywithMIK Жыл бұрын
Thank you for understanding Aaditya ❤️
@somsk562 ай бұрын
Sir , I GUESS STACK APPROACH , IT IS NOT OK FOR INTERVIEW RIGHT ? SO WHICH ONE I HAVE TO FOLLOW PLEASE TELL ME
@codestorywithMIK2 ай бұрын
You can use any approach. Totally depends on what the interviewer wants.
@somsk562 ай бұрын
@@codestorywithMIK If you are interviewer then what do you prefer sir ?
It will come soon . Sorry for the delay. Have been travelling this weekend. But it will be uploaded today. Few things : 1) The best part about today’s qn is that it can be solved using already used template of TRIE that I taught. It will be fun ✌️❤️