Please watch our new video on the same topic: kzbin.info/www/bejne/r5eWoIieoNukd5I
@ahishnar15683 жыл бұрын
About to practice this question and notification appeared. What a timing 😅 Consistency 🔥🔥🔥 Thanks for the video Bhaiya.
@gauravgautam59632 жыл бұрын
literally . I have to say you explain it very well. As i have tried from many video to understand this question but your way of explaining is on another level
@sumitkulkarni39503 жыл бұрын
geeksforgeeks has very lengthy code for this question. You have simplified it. Thanks
@takeUforward3 жыл бұрын
Please like, share and subscribe to these kind of content also. Do let me know in comment section if you have understood or not :) New and better edition: kzbin.info/www/bejne/r5eWoIieoNukd5I
@AmanKumarSinhaOfficial3 жыл бұрын
Please Bhaiya... Make a video for BCA Student who wants to get job just after completing BCA - Off campus roadmap...
@takeUforward3 жыл бұрын
@@AmanKumarSinhaOfficial areh mene wo chiz kia hi nai, toh video kese banaye bhai.
@AmanKumarSinhaOfficial3 жыл бұрын
@@takeUforward .......
@ratnadeepbhattacharya32373 жыл бұрын
Bhaiya trees ka series kab ayega like approximate time kuch? BTW nice explanation.....keep up the gd work 👍
@manaswitadatta3 жыл бұрын
Hi, can you pls provide the link for the SDE theory topics sheet. I remember seeing it but can't find the link. Pls.
@laraibanwar16183 жыл бұрын
I really appreciate your work what you are doing for the students of college level I am already working in a company but I do codeforces generally One algorithm on which I had the most difficulty was line sweep algorithms Can u make videos on that topic for the students It would be great U can find the sources from hackereath and topcoder as well or from cp algorithms Thanks
@teetanrobotics53632 жыл бұрын
Thank you striver for your amazing playlists. Could you please make a playlist on "STRINGS" as well ?
@RonitChattopadhyay3 жыл бұрын
Hello Striver Bhai.. Thanks for your hard work. Your videos are followed not just by students, but experienced software engineers also like me.
@tanmaysinghal83702 жыл бұрын
nice way to check the count of how many rotten oranges are there ... i just used a double for loop to check if there is any 1 left in the matrix... couldn't think of your way
@dhruvsharma79643 жыл бұрын
Great video, just need a clarification. You have told in live class that we should never change the given value in input, but here you have modified the grid.
@takeUforward3 жыл бұрын
Yeah if I was giving interview, I would have asked the interviewer, here i was solving a lc problem, so did it like this.. General order: Ask the interviewer, generally they will ask you not to modify it :)
@dhruvsharma79643 жыл бұрын
@@takeUforward In that case should I make a copy of the grid and then modify that or is there some better way?
@HarivanshKripaVlogs3 жыл бұрын
That happiness when your video appears at the top..!!! Aab to ache se samajh aa jayega
@bhaveshkumar68422 жыл бұрын
I am the biggest fan of the way you teach and I also get to learn how to write neat code.
@alternative82343 жыл бұрын
Brother you're doing a beautiful work. Hope to thank you in person someday.
@akshatsemwal_143 жыл бұрын
BHAIYA PLEASE MAKE A VIDEO FOR A FRESHER 1ST YEAR IN TIER 3 COLLEGE COMPUTER SCIENCE BRANCH. 1. ROADMAP STARTING OF COLLEGE TILL END OF PLACEMENT A PROPER DETAILED ONE WITH SOURCES OF SITE OR APP TO PURSUE CODING COURSES TO GET PLACED IN TOP MNC's 2. ALSO, COMPANIES AND TIME AT WHICH ONE SHOULD APPLY FOR PAID/NON-PAID INTERNSHIPS. 3. ALSO PROPER TIME ONE SHOULD INVEST IN HIS CO-CURRICULAR ACTIVITIES + CODING + COLLEGE STUDY. 4 . AND EVERYTHING ABOUT GATE EXAM WHETHER ONE SHOULD THINK ABOUT IT AND HOW TO MANAGE BOTH ROADMAPS AS WELL AS PREPARATION AND ALSO WHEN TO PREPARING FOR GATE. 5. STUDY MATERIAL TO FOLLOW IN ORDER TO MAINTAIN COLLEGE GRADES. PLEASE BHAIYA DO MAKE A VIDEO!!!
@karanudayandas16083 жыл бұрын
Time and Space Complexity :- 25:06
@baranikumar62203 жыл бұрын
Clear explanation . You made it quite easy to understand this problem. Thank a lot !
@dheerajgoyal64713 жыл бұрын
in the if statement of c++ code where you are checking the !=1, there can be a value which is equal to 0 and in that case why we have to mark that as 2(rotton) the if will also contain(&&grid[nx][ny[!=0)?
@takeUforward3 жыл бұрын
Only if its 1 we mark else we don’t
@tulika28633 жыл бұрын
How to think whether BFS or DFS should be applied on the grid? I always get stuck in this. Please reply.
@takeUforward3 жыл бұрын
Its a standard problem. Generally when there is a pattern of movement. Like here its always 4 directions. Both bfs and dfs can be applied.. Dfs is preferred when we need some backtracking stuff. Here we did not, so bfs dfs both work fine
@vighneshhegde45803 жыл бұрын
Like, whenever u are seeing that it is radially increasing, then there is a strong chance that BFS will be applicable over there
@tulika28633 жыл бұрын
@@takeUforward Thank you 😇
@tulika28633 жыл бұрын
@@vighneshhegde4580 Thank you 😇
@samgodse97713 жыл бұрын
You are Great Striver ! Keep it Up | No one Provides This Level of Contents Even Paid Courses can't match with Your KZbin Free Contents. Thank you
@lakshminagaraju2063 жыл бұрын
Thank you for the great explanation. You are truely inspiration
@bhavyanayyer33913 жыл бұрын
Sir pls make video on distinct subsequences (dp) and regular expression match pls🙏
@nishchaygupta99882 жыл бұрын
Hey, the overall explanation is great. But I have one doubt in the S.C. It should be O(n*n) + O(2n) for vector of vector and queue.
@Lovekush-kx5kz2 жыл бұрын
Ya it can be but overall it becomes O(n*n)
@nishchaygupta99882 жыл бұрын
@@Lovekush-kx5kz alright
@kabirbanerjee61593 жыл бұрын
Thanks bhaiya for explaining the problem in such an amazing way . I am currently in first year and I have solved most of the questions in the SDE sheet myself . Bhaiya I want to ask a question that from second year should I learn web development or android development and focus on dev related things or should I continue with problem solving . Bhaiya please reply.
@abhinavshukla64183 жыл бұрын
i am a student of DTU ,is CP necessary for beiing placed in a gud company ,isnt leetcodde nd gfg sufficient??
@bharatpipare76553 жыл бұрын
Bhaiyya Will you please explain us the Time complexity n It's notations in a simple way, I am facing difficulty while understanding.
@aryanyadav39262 жыл бұрын
Thanks for the brilliant explanation!
@itianshub56503 жыл бұрын
Great Explanation Bhaiya. Thnk u...
@unnatimishra3 жыл бұрын
I badly needed this video, Thank Youu for making 🤩
@aarushi66013 жыл бұрын
Will using dfs make the problem complicated? Is that why it is not used
@jaiminsolanki54783 жыл бұрын
We can't thank you enough Raj Bhaiya!
@adityatiwari10222 жыл бұрын
can this problem be solved using recursion?
@sukritakhauri652 жыл бұрын
Loved the explanation
@dollyyadav32512 жыл бұрын
y u did'nt maintain a visited grid so that while making call in 4 directions we don't need to recompute for the previously visited cell of the grid.
@rishabhkumar81153 жыл бұрын
can someone please explain me why we are updating our day only when the q size is not 0, . it becomes zero in last iteration so our day will become less then 1??
@jatilyadav40002 жыл бұрын
amazing explaination
@himeshgupta64783 жыл бұрын
I am from non cse background can you please guide me. What kind of questions are asked from operating systems for placement interviews??
@shrimpo64163 жыл бұрын
GREAT explanation and very clean, elegant code!
@kundanranjan3 жыл бұрын
How does the algorithm make sure that the time taken is minimum ? Or I think the time is fixed and there can not be any minimum or maximum time. Correct me if I am wrong.
@SantoshSHARMA-vb1kv2 жыл бұрын
hey striver!! can u plz tell why this code is creating problem as it is error ....if u can guide it'll be really very helpful
@vikashkumar77622 жыл бұрын
Bahut shi explain kia h BOSS
@pallavibhasme133 жыл бұрын
Hi ...can plz make a video on, how to make project... I'm 3 yr student but don't know how to make even staring of projects , and which topic is to select... plzz
@yeswanthh50682 жыл бұрын
Understood sir
@sushantkhattar25983 жыл бұрын
Very well explained solution.Thanks 👍
@ytsh57522 жыл бұрын
Thanks sir
@stutij79223 жыл бұрын
What will be the time complexity if I solve using DFS I will have to call DFS multiple times to ensure that final time is minimum. Could you plz explain time complexity in dfs
@ore_wa_king3 жыл бұрын
Thank you Sir
@nitinshukla49602 жыл бұрын
Thanks Striver Buddy
@codeguy213 жыл бұрын
consistency level 100...
@_-69123 жыл бұрын
I understood the solution!
@jatinagarwal16052 жыл бұрын
What if grid does contains more than one rotten oranges then code doesn't seems to work since count_fresh!=cnt in that case..correct me if I'm wrong
@lifegood64013 жыл бұрын
Superb Explanation as always..
@bhaveshkumar68422 жыл бұрын
Thank you, Striver!!!!
@ayeshasumaiya82802 жыл бұрын
Best Explaination💯
@manasdeora46012 жыл бұрын
Amazing explanation man!
@jatilyadav40002 жыл бұрын
thank you soo much ...highly appreciated
@freshcontent37293 жыл бұрын
bro upload more videos like reverse the string with all approaches
@chandangunaga68103 жыл бұрын
Doubt!! Doubt!! Sir please do check my comment... I am in my end of 3rd year and i am from a tier 3 college... I have started my DSA journey... I m refering your SDE sheet I have doubt in my way of learning it.. I am seeing your solution tutorial , understanding the problem, and write the code by myself after watching the complete video... Is this method is right?or Any suggestion frkm you sir so that i can get a placement in PBC?
@takeUforward3 жыл бұрын
Way to go
@KshitijJain2 жыл бұрын
Hey, Can you please cover Trapping Rain Water problem please.
@takeUforward2 жыл бұрын
I did
@KshitijJain2 жыл бұрын
@@takeUforward it should be also in stack playlist?
@swetajha22653 жыл бұрын
good explanation!!
@pedadagopal30623 жыл бұрын
brother,if possible try to also make videos of problems in cp sheet and cr sheet.Also some hackearth links are not working in cp sheet it is showing 404 not found.
@abhishekagarwal38433 жыл бұрын
I want the next video on Rabin karp and z algorithm please!
@angshuman_roy3 жыл бұрын
I m in my last year but still struggling with basic dsa ,what should I do considering I do have now a time constrain ?
@abhinavshukla64183 жыл бұрын
bulk recruitment
@rajatverma79363 жыл бұрын
its Just Wonderful
@AmanKumarSinhaOfficial3 жыл бұрын
Please Bhaiya... Make a video for BCA Student who wants to get job just after completing BCA - Off campus roadmap...
@AdityaPrakashSinha3 жыл бұрын
👍👍👍
@Ryan-mr9pn3 жыл бұрын
Why the dfs approach wasn't chosen here and instead we went with bfs
@tusharrustagi57292 жыл бұрын
understood
@freshcontent37293 жыл бұрын
Conintute the sheet bro placements are startinig! increase upload frequnecy and thanks again
@sankalpmehadia92523 жыл бұрын
An alternate solution using O(1) space: class Solution { //Function to find minimum time required to rot all oranges. public boolean check(int[][] grid) { //checks if there is some fresh orange and mekes all -1 to 2 so we don't need extra space int n=grid.length; int m=grid[0].length; boolean b=true; for(int i=0;i
@takeUforward3 жыл бұрын
this isn't o(1) space, when you modifying the given data, we consider that into space complexity as well.. Also interviewers don't like such solutions where you modify the give grid..
@sankalpmehadia92523 жыл бұрын
@@takeUforward Ok thanks for informing!!
@Mysterious_debris_11112 жыл бұрын
Wonderful content. Thanks man !
@aswinaspirant41003 жыл бұрын
Amazing brother !
@nileshsinha78693 жыл бұрын
Great explanation as always🔥❣️
@codewithme90163 жыл бұрын
That is clear 👍
@VirajChokhany3 жыл бұрын
Thanks striver. OP explanation 🔥
@gauravshukla66753 жыл бұрын
kabhi kabhi sochta hu striver bhai ko doubt ayega to vo kisse samjhenge
@satyampande6842 жыл бұрын
understood!!
@fardeenshaikh64343 жыл бұрын
Eid Mubarak Bhaiya
@PrinceKumar-el7ob3 жыл бұрын
As perfect as always !!
@rishabhkumar81153 жыл бұрын
if(like_button != 1){ while(1){ like_striver_video(); } } really, such a nice man you are and very very helpful.
@manasharsitraj32263 жыл бұрын
Love you sir
@dhanashreegodase44452 жыл бұрын
why bfs? and not dfs
@vimalmaury97453 жыл бұрын
Why r u so awesome 🌝btw thanku so much keep helping us
@amansamal82332 жыл бұрын
understood❤❤
@radhe13353 жыл бұрын
Striver OP 💥💥🔥🔥
@surajkumarsingh48573 жыл бұрын
Keep going brother 💯💯
@whatsupdiv3 жыл бұрын
noooo its over
@cy.sumit023 жыл бұрын
Found u raja da It's Barce ❤️
@takeUforward3 жыл бұрын
Haha
@AshishKumar-pq6pr3 жыл бұрын
Maja aa gya 😅🤟
@rajananarve50893 жыл бұрын
Hi
@SahilSharma-vl9rk3 жыл бұрын
Eid Mubarak bhai jaan ☺️❤️
@takeUforward3 жыл бұрын
Eid mubarak
@e889.3 жыл бұрын
💯
@saurabhsingh-sy4oh3 жыл бұрын
🙌🙌
@pabitradakua81133 жыл бұрын
Bhai 🔥
@kunalsihare52443 жыл бұрын
bhiya your voice is not clear bad mike quality
@takeUforward3 жыл бұрын
Okay bro. Did not find this feedback from anyone, still will get this checked! Thanks
@himanshu2983 жыл бұрын
Please enjoy your vacation instead of uploading videos..