end sem exams are there and here i m solving daily problems obsessed hogaya hu roz new sikhna thought process clg ki padhai touch tak nhi kari but hum engineer hai aaj rat bhar baithkr pass hona jitna likhdenge thnku mik bhaiya for being consistently uploading daily videos bas apki wajah se coding me interest aya hai ..
Thnx for approach man, coding it was easy. Gonna stop looking at topics when i get stuck because of that i kept thinking of greedy approaches when the simplest approach was right in front of me
Bro maine jab question deka tho hope chod diya tha ki kaise manuplate kare simulation kare. Par apne tho alag hi level pe , really yaar thank you so much
@@Shubham-et8qk nahi bhai maine 4 mahine se inko folllow kar rha hu 2 company ke last and second last round se bhar hua hu but waha tak qualify DSA se hiii hua h
@@vedantporwal3961 haa bhai aaj kal oa round >>>>>> final round interview. Chalo achi baat hai mai bhi lga hua hai bas ek flow bnta hai fir toot jata hai but chlo krte hai mehnat . ALL THE BEST 👍🏻🙂
It would be helpful if anyone would solve this problem which is a modified version of this : So the objective of problem is to find the number of swaps to make the entire matrix positive, if not then return -1. For the first test case that ismatrix = [[1,-1],[-1,1]] the ans would be 2, but for the 2nd test case the ans would be -1 as it is not possible to make array positive
solve by own more than 3 months I following mik it was very helpful for me thanku🤞🤞 this is my approach class Solution { public: long long maxMatrixSum(vector& matrix) { long long ans=0; int minval=INT_MAX; int countneg=0; for(int i=0;i
Dear Afnan, First of all, best of luck for your Amazon SDE interview. You have got this! For last-minute tips: Don’t study anything new. Focus on common patterns like sliding window, binary search, recursion, and dynamic programming. Revise problems you've already solved. System Design (if you are experienced 1-2 years) : If applicable, keep concepts like scalability and database choices in mind. Behavioral Questions: Use the STAR method (Situation, Task, Action, Result) to frame your answers. Amazon loves leadership principles, so align your responses with them. Relax and get a good night’s sleep before the interview to stay sharp and confident. You’re well-prepared - trust your hard work. Do let us know how it goes 😇🙏❤️
class Solution { public: long long maxMatrixSum(vector& matrix) { long long sum = 0; int negCount = 0, minNum = INT_MAX, n = matrix.size(); for(int i = 0; i < n; i++) for(int j = 0; j < n; j++) { sum += abs(matrix[i][j]); if(matrix[i][j]
when i first saw it i though greedy can't work, backtrack will take too much time, did n't knew how DP can work so i got that there would be any clever approach that i can't myself think of It happens many times with me So the main problem comes that we don't have right example to think, like you had examples diff. than what were given in leetcode testcases so how can we think of right examples which can help find the needed logic ? ty
class Solution { public: long long maxMatrixSum(vector& matrix) { int n = matrix.size(); int smallest = INT_MAX; long long sum = 0; int negativeCount = 0; for(int i=0 ; i
Sir,,please post solutions of leetcode biweekly as well as weekly contest ,,,it would be of great use for all of us in terms of learning through those problems...
I got some time today and posting Qn-3 of today’s contest. It’s a very good problem and an ideal candidate to come in interview. Make sure you try it. If i find some more time today, i will post other Qns as well ❤️🙏
Hi MIK, I have a doubt what if there are even number of negative elements in the matrix (5x5) and one of them is at the center ([2][2]) then how it will become positive eventually.The rules say the operation can be applied only on those who share a border.Please Clarify
What if there is a zero in the matrix? Even if the negative number count is odd, we can still make all numbers positive. Is this actually an edge case or am I just overthinking? I wrote this solution: class Solution { public: long long maxMatrixSum(vector& matrix) { int n=matrix.size(); bool iszero=false; int count=0; int element_to_delete=INT_MAX; long long ans=0; for(int i=0;i
end sem exams are there and here i m solving daily problems
obsessed hogaya hu roz new sikhna thought process clg ki padhai touch tak nhi kari but hum engineer hai aaj rat bhar baithkr pass hona jitna likhdenge
thnku mik bhaiya for being consistently uploading daily videos bas apki wajah se coding me interest aya hai ..
Same bhai
bro also take care of your cgpa if u want to sit in campus placement bcz if u dont able to clear the cutoff then u r not allowed to sit in placements
@ han yes bhai 7 ke upar hai
@@jain5184 that's good❤️
@@jain5184 kha se ho bhai or konse year me ho konse clg me?
I figured out the trick myself today, Im soo happy..literally cured my depression.
done myself, thanks a ton
Radhe Radhe ❤
Radhe Radhe ❤️🙏
Thnx for approach man, coding it was easy. Gonna stop looking at topics when i get stuck because of that i kept thinking of greedy approaches when the simplest approach was right in front of me
Bro maine jab question deka tho hope chod diya tha ki kaise manuplate kare simulation kare. Par apne tho alag hi level pe , really yaar thank you so much
wow the thought process blown my mind
thnku so much
aisa intutuion pata nhi kab build hoga
Keep practising. Hojaega
Definitely, things take time, and I am ready to give my time.
very help full approach , thank you!!
its never too late..❤
4th year hu apke karn DSA karne ka mann hota h thanks an lot
Placement lg gyi ? Ya abhi start Kiya hai bro DSA ?
@@Shubham-et8qk nahi bhai maine 4 mahine se inko folllow kar rha hu
2 company ke last and second last round se bhar hua hu
but waha tak qualify DSA se hiii hua h
@@vedantporwal3961 haa bhai aaj kal oa round >>>>>> final round interview. Chalo achi baat hai mai bhi lga hua hai bas ek flow bnta hai fir toot jata hai but chlo krte hai mehnat . ALL THE BEST 👍🏻🙂
Everything is temporary but the pressure cooker sound in the video is permanent😄
It would be helpful if anyone would solve this problem which is a modified version of this :
So the objective of problem is to find the number of swaps to make the entire matrix positive, if not then return -1.
For the first test case that ismatrix = [[1,-1],[-1,1]] the ans would be 2, but for the 2nd test case the ans would be -1 as it is not possible to make array positive
awesome explanation you are my one of the favorite youtuber thanks a lot🧡
I liked this problem . Good one
solve by own
more than 3 months I following mik it was very helpful for me thanku🤞🤞
this is my approach
class Solution {
public:
long long maxMatrixSum(vector& matrix) {
long long ans=0;
int minval=INT_MAX;
int countneg=0;
for(int i=0;i
Thank you so much
0:35
It’s never too late ❤
Assalamualaikum Bhaiyya,
my Amazon SDE interview is scheduled for 3rd December. I’d really appreciate some last-minute tips...
Dear Afnan,
First of all, best of luck for your Amazon SDE interview. You have got this! For last-minute tips:
Don’t study anything new. Focus on common patterns like sliding window, binary search, recursion, and dynamic programming. Revise problems you've already solved.
System Design (if you are experienced 1-2 years) : If applicable, keep concepts like scalability and database choices in mind.
Behavioral Questions: Use the STAR method (Situation, Task, Action, Result) to frame your answers. Amazon loves leadership principles, so align your responses with them.
Relax and get a good night’s sleep before the interview to stay sharp and confident.
You’re well-prepared - trust your hard work.
Do let us know how it goes 😇🙏❤️
@@codestorywithMIK Thank you so much bhaiyya for your valuable advice and encouragement.. I’ll focus on these tips and keep you posted..
class Solution {
public:
long long maxMatrixSum(vector& matrix) {
long long sum = 0;
int negCount = 0, minNum = INT_MAX, n = matrix.size();
for(int i = 0; i < n; i++)
for(int j = 0; j < n; j++) {
sum += abs(matrix[i][j]);
if(matrix[i][j]
segment tree sa kiya bhai mena.
@@himadrinath1502 Can you share your solution over here?
when i first saw it i though greedy can't work, backtrack will take too much time, did n't knew how DP can work so i got that there would be any clever approach that i can't myself think of It happens many times with me So the main problem comes that we don't have right example to think, like you had examples diff. than what were given in leetcode testcases so how can we think of right examples which can help find the needed logic
?
ty
class Solution {
public:
long long maxMatrixSum(vector& matrix) {
int n = matrix.size();
int smallest = INT_MAX;
long long sum = 0;
int negativeCount = 0;
for(int i=0 ; i
Sir,,please post solutions of leetcode biweekly as well as weekly contest ,,,it would be of great use for all of us in terms of learning through those problems...
I got some time today and posting Qn-3 of today’s contest. It’s a very good problem and an ideal candidate to come in interview. Make sure you try it.
If i find some more time today, i will post other Qns as well ❤️🙏
@@codestorywithMIKplease sir, try to post contest questions also.
@@codestorywithMIK atleast last two questions
Hi MIK, I have a doubt what if there are even number of negative elements in the matrix (5x5) and one of them is at the center ([2][2]) then how it will become positive eventually.The rules say the operation can be applied only on those who share a border.Please Clarify
1 -1 1 1 1
1 1 1 1 1
1 1 -1 1 1
1 1 1 1 1
1 1 1 1 1
select matrix[0][1] and iska adjacent matrix[0][2], dono me -1 multiply karo
1 1 -1 1 1
1 1 1 1 1
1 1 -1 1 1
1 1 1 1 1
1 1 1 1 1
Now, select matrix[0][2] and iska adjacent matrix[1][2], dono me -1 multiply karo
1 1 1 1 1
1 1 -1 1 1
1 1 -1 1 1
1 1 1 1 1
1 1 1 1 1
Now, select matrix[1][2] and iska adjacent matrix[2][2], dono me -1 multiply karo
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
1 1 1 1 1
-ve ko Propagate karke hojaega always.
What if there is a zero in the matrix? Even if the negative number count is odd, we can still make all numbers positive. Is this actually an edge case or am I just overthinking? I wrote this solution:
class Solution {
public:
long long maxMatrixSum(vector& matrix) {
int n=matrix.size();
bool iszero=false;
int count=0;
int element_to_delete=INT_MAX;
long long ans=0;
for(int i=0;i
Sometimes i can solve medium problem very easily but some time I can't intuit a easy problem😔Feels like I'm of no worth.
Please don’t think so.
It happens to everyone ❤️
@@codestorywithMIK Thanks Mik sir. Your motivational quote is my daily fuel.