The Best thing of this video is You expln Approach 1 to understand the logic but also expln the Approach 2 to optimized this problem this proves your dedication level for us . thank you
@codestorywithMIK6 ай бұрын
❤️❤️🙏🙏
@abhirajsingh30713 ай бұрын
Loved it, did not expected that someone will explain this so smoothly, thanks
@gui-codes6 ай бұрын
I solved it on my own. Thanks a lot mik for helping me being consistent.
@ganeshjaggineni40976 ай бұрын
NICE SUPER EXCELLENT MOTIVATED
@jeehub0416 ай бұрын
Sir aapke explanations gajab ha, aap Great ho agar kisi ko coding me interest na ho aur voh ek baar aapka teaching delh le 🙌🙌
@nupurkuhite49676 ай бұрын
Sir, Thanks jo aap ka 2nd approach hai vo que padhane ke baad mujhe bhi ye idea aya tha lekin mene shrif rowMin ka Max value nikala tha, colMax ka Min nahi islye answer wrong aya tha. Thanks to resolve my doubt.
@anuragsingh25566 ай бұрын
sir i have one doubt i wish you reply to this comment when we add answer in our result you used this condition if (matrix[row][col] == rowMin.get(row) && matrix[row][col] == colMax.get(col)) { result.add(matrix[row][col]); } but i used if(matrix[i][j] == min.get(i) && min.get(i) == max.get(j)) ans.add(min.get(i)); } how these both condition are different
@RohitKumar-dz8dh6 ай бұрын
Thanks 😊
@ryuu57686 ай бұрын
class Solution { public: pairfindmin(vector& matrix,int &i){ int mini=INT_MAX; int index=-1; for(int j=0;jmatrix[i][j]){ index=j; mini=matrix[i][j]; } } return {mini,index}; } bool ismaxincol(vector& matrix,int maxi,int j){ for(int i=0;i
@_A__Mohit6 ай бұрын
Please segment tree videos sir please 😢 🙏🙏🙏🙏
@nesh3986 ай бұрын
Without using 2 seperate arrays use MAP class Solution { public: vector luckyNumbers(vector& matrix) { int n = matrix.size(); int m = matrix[0].size(); unordered_map holder; vector ans; for (int i = 0; i < n; i++) { int mini = INT_MAX; for (int j = 0; j < m; j++) { mini = min(mini, matrix[i][j]); } holder[mini]++; } for (int i = 0; i < m; i++) { int maxi = INT_MIN; for (int j = 0; j < n; j++) { maxi = max(maxi, matrix[j][i]); } holder[maxi]++; } for (auto elem : holder) { if (elem.second == 2) { return {elem.first}; } } return 0; } };
@codestorywithMIK6 ай бұрын
Very nice ❤️
@gauravbanerjee28986 ай бұрын
Thanks a lot bhaiya ❤❤
@thefinalfit6 ай бұрын
Done on my own 😊
@utkarshsahay99086 ай бұрын
class Solution { public: vector luckyNumbers (vector& matrix) { unordered_map mp; vector ans; for(int i = 0;i < matrix.size(); i++){ int mini = *min_element(begin(matrix[i]),end(matrix[i])); int idx = min_element(begin(matrix[i]),end(matrix[i])) - begin(matrix[i]); mp[mini] = idx; } for(auto it : mp){ int ele = it.first; int col = it.second; int maxi = INT_MIN; for(int row = 0;row < matrix.size(); row++){ maxi = max(maxi,matrix[row][col]); } if(maxi == ele) ans.push_back(ele); } return ans; } };❤❤
@YashMalav-kh1ov6 ай бұрын
first viewer...🙂
@reyazahmed48556 ай бұрын
Dfs approach for number of good leaves yesterday problem please upload
@codestorywithMIK6 ай бұрын
Yes, planning this soon by tomorrow
@codestorywithMIK6 ай бұрын
Coming today only 🙂❤️
@reyazahmed48556 ай бұрын
@@codestorywithMIK Thanks buddy. Hope you doing great. Awesome channel
@j_ourney256 ай бұрын
Can we write in if condition if(rowmin[row] == colmax[col]{ }
@codestorywithMIK6 ай бұрын
Definitely yes 👍🏻
@nawazthezaifre88706 ай бұрын
Array + Matrix = dimag ghum jata hai konsa loop kha chlega solution dekh lo samjh aa jata hai nhi to solve nhi hote is type ke question.
@singhshek586 ай бұрын
vector luckyNumbers (vector& matrix) { int n=matrix.size(); int m=matrix[0].size(); unordered_setst; for(int i=0;i
@ryuu57686 ай бұрын
class Solution { public: pairfindmin(vector& matrix,int &i){ int mini=INT_MAX; int index=-1; for(int j=0;jmatrix[i][j]){ index=j; mini=matrix[i][j]; } } return {mini,index}; } bool ismaxincol(vector& matrix,int maxi,int j){ for(int i=0;i
@TheBusaSinger6 ай бұрын
❤❤
@maniBrave6 ай бұрын
java wale kitne h wsese
@aggarwalsachin48546 ай бұрын
ye contradiction wala logic kaise aya bro dimaag m???
@codestorywithMIK6 ай бұрын
Hi there, It was a hit and trial initially. I also realised for any example i was always getting one Lucky number. And hence came to this. Hope it helped 😊❤️🙏