We can also do this by maintaining a Parent array, and storing min path for every node, and then for the query just search if that edge is present in our array
I could not solve this due to time but now I think I could have solved it by making 1-2 mistakes. thank you so much for improving my dsa. I am finally now able to solve 2-3 qns in leetcode contests
Minimum Number of Operations to Satisfy Conditions Sir please make video on this one and yeah thanks to you i was able to solve 4rth question in todays contest for the first time ever
Sir i have new doubth 1254. Number of Closed Islands This code is work but if i change the dfs to logic for 4 direction and do nothing why it give wrong answer: class Solution { public: bool dfs(int i,int j,vector &grid){ if(i=grid.size() || j>=grid[0].size()) return false; if(grid[i][j]==1 || grid[i][j]==2) return true; grid[i][j]=2; //when i found 0; bool down = dfs(i+1,j,grid); bool right = dfs(i,j+1,grid); bool up = dfs(i-1,j,grid); bool left = dfs(i,j-1,grid); return down && right && up && left; } int closedIsland(vector& grid) { int n = grid.size(); int m = grid[0].size(); int cnt=0; for(int i=0;i
@@codestorywithMIK bhaiya,kabhi aap double dijkstra par video banao toh please yeh optimisation ka dry run bata dijiyega, mujhe doubt yeh hai ki agar vo node pehle visited toh Hui par kisi let say A node se vahan visit Kiya aur ab ki baar Jo visit kar rhe hai same node ko par hum kisi B node se vahan ke liye check kar rhe hain....
Correction : Time complexity of Dijkstra is O(ElogV) . My bad for the silly 😅
BHAIYA THIS IS TOO AWESOME!!! HOW CAN SOMEONE TEACH SOOO GR8 😍
Sir please upload 3rd one I have tried greedy it is too confusing
i think greedy will fail. dp will be used
I solved using dp.
First 10 minutes are enough to solve the problem, thanks 😊
We can also do this by maintaining a Parent array, and storing min path for every node, and then for the query just search if that edge is present in our array
Awesome
I could not solve this due to time but now I think I could have solved it by making 1-2 mistakes. thank you so much for improving my dsa. I am finally now able to solve 2-3 qns in leetcode contests
amazing explaination as usual
oneof the best explanation so far.🎉❤
Means a lot ❤️❤️🙏🙏
bhai legend ho tum
Minimum Number of Operations to Satisfy Conditions Sir please make video on this one
and yeah thanks to you i was able to solve 4rth question in todays contest for the first time ever
Can you make video on this question with second approach using parent vector.
Plz solve The latest time to catch a bus using BINARY SEARCH approach.
Leetcode problem no.2332
Legend for a reason. 🔥🔥
Qn-4 made halwa
Amazing ❤❤❤❤❤❤❤
Sir i have new doubth
1254. Number of Closed Islands
This code is work but if i change the dfs to logic for 4 direction and do nothing why it give wrong answer:
class Solution {
public:
bool dfs(int i,int j,vector &grid){
if(i=grid.size() || j>=grid[0].size()) return false;
if(grid[i][j]==1 || grid[i][j]==2) return true;
grid[i][j]=2; //when i found 0;
bool down = dfs(i+1,j,grid);
bool right = dfs(i,j+1,grid);
bool up = dfs(i-1,j,grid);
bool left = dfs(i,j-1,grid);
return down && right && up && left;
}
int closedIsland(vector& grid) {
int n = grid.size();
int m = grid[0].size();
int cnt=0;
for(int i=0;i
Thank You so much bhai ❤❤
bhaiya apke tarha story ko code mai badlne practice kaise kare please bhaiya share some way to do so.
Great Explanation sir!! Just one doubt i think Time complexity of Dijikstra is O(E*logV) and Not O(V+E).
Ah so sorry. My bad for this silly.
I added the correction in my Pinned Comment.
Thanks a lot ❤️❤️
bhaiya third question dp ke alwa koi aur approach se solve ho sakta hai kya .Agar ha toh Please ispar video bana dijiye.
weekly contest 394 question 3 ka bhi sol upload kardo pls...
bhai yeh jo apne visited se dijkstra ko optimize kra hai usse thoda aur explain kr skte ho??? yeah dijkstra ka part 3 video banaoge???
bhaiya aapne jo java bala code he usme one test case pass nhi ho raha he aap ek bar chek kar lijiye;
Corrected.
Thanks a lot for pointing it out
Sir can you please share your dsa sheet ?
You can find the sheets link in this page -
github.com/MAZHARMIK
It has all details
Thank you ❤️❤️
bhaiya vo visited vala optimization dhang se samajh nhi aaya
Actually it’s just used to avoid visiting an already visited node.
You would not want to visit an already visited node.
@@codestorywithMIK bhaiya,kabhi aap double dijkstra par video banao toh please yeh optimisation ka dry run bata dijiyega, mujhe doubt yeh hai ki agar vo node pehle visited toh Hui par kisi let say A node se vahan visit Kiya aur ab ki baar Jo visit kar rhe hai same node ko par hum kisi B node se vahan ke liye check kar rhe hain....
Sure, I will cover that 👍🏻
god English please
good bro