Maximum Matrix Sum | Simple Thought Process | Leetcode 1975 | codestorywithMIK

Поделиться
HTML-код
  • Опубликовано: 26 ноя 2024

Комментарии • 52

  • @jain5184
    @jain5184 3 дня назад +26

    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 ..

    • @shigoeditz7079
      @shigoeditz7079 3 дня назад +2

      Same bhai

    • @DrOnZeR2022
      @DrOnZeR2022 3 дня назад +1

      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

    • @jain5184
      @jain5184 3 дня назад +3

      @ han yes bhai 7 ke upar hai

    • @DrOnZeR2022
      @DrOnZeR2022 3 дня назад +1

      @@jain5184 that's good❤️

    • @DrOnZeR2022
      @DrOnZeR2022 3 дня назад +1

      @@jain5184 kha se ho bhai or konse year me ho konse clg me?

  • @ArjunSingh-pm2vt
    @ArjunSingh-pm2vt 3 дня назад +1

    I figured out the trick myself today, Im soo happy..literally cured my depression.

  • @simply_akh1l
    @simply_akh1l 3 дня назад +2

    done myself, thanks a ton

  • @amanpaliwalvlogs6860
    @amanpaliwalvlogs6860 3 дня назад +5

    Radhe Radhe ❤

  • @Aditya-qx7nf
    @Aditya-qx7nf 3 дня назад +1

    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

  • @deepakd6252
    @deepakd6252 3 дня назад +1

    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

  • @DEEPJAIN_
    @DEEPJAIN_ 3 дня назад +1

    wow the thought process blown my mind
    thnku so much
    aisa intutuion pata nhi kab build hoga

  • @crazygamerrohan9899
    @crazygamerrohan9899 3 дня назад +1

    Definitely, things take time, and I am ready to give my time.

  • @fr4nkyyy720
    @fr4nkyyy720 3 дня назад +5

    very help full approach , thank you!!

  • @hare_krishna8411
    @hare_krishna8411 3 дня назад +7

    its never too late..❤

  • @vedantporwal3961
    @vedantporwal3961 3 дня назад +4

    4th year hu apke karn DSA karne ka mann hota h thanks an lot

    • @Shubham-et8qk
      @Shubham-et8qk 3 дня назад +1

      Placement lg gyi ? Ya abhi start Kiya hai bro DSA ?

    • @vedantporwal3961
      @vedantporwal3961 2 дня назад +1

      @@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

    • @Shubham-et8qk
      @Shubham-et8qk 2 дня назад +1

      @@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 👍🏻🙂

  • @m.baliramgupta
    @m.baliramgupta 3 дня назад +2

    Everything is temporary but the pressure cooker sound in the video is permanent😄

  • @mr_stranger3867
    @mr_stranger3867 3 дня назад +2

    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

  • @sumithitsyt4093
    @sumithitsyt4093 3 дня назад +1

    awesome explanation you are my one of the favorite youtuber thanks a lot🧡

  • @thekindspill
    @thekindspill 3 дня назад +1

    I liked this problem . Good one

  • @basu8870
    @basu8870 3 дня назад +2

    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

  • @ugcwithaddi
    @ugcwithaddi 3 дня назад

    Thank you so much

  • @aws_handles
    @aws_handles 3 дня назад

    0:35
    It’s never too late ❤

  • @mohd-afnan-shahab
    @mohd-afnan-shahab 3 дня назад +3

    Assalamualaikum Bhaiyya,
    my Amazon SDE interview is scheduled for 3rd December. I’d really appreciate some last-minute tips...

    • @codestorywithMIK
      @codestorywithMIK  3 дня назад +1

      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 😇🙏❤️

    • @mohd-afnan-shahab
      @mohd-afnan-shahab 3 дня назад

      @@codestorywithMIK Thank you so much bhaiyya for your valuable advice and encouragement.. I’ll focus on these tips and keep you posted..

  • @rushabhlegion2560
    @rushabhlegion2560 3 дня назад +2

    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]

  • @Diljit_dosanjh_
    @Diljit_dosanjh_ 3 дня назад

    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

  • @best4567
    @best4567 3 дня назад +1

    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

  • @AtulBhadouriya-m8s
    @AtulBhadouriya-m8s 3 дня назад

    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...

    • @codestorywithMIK
      @codestorywithMIK  3 дня назад

      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 ❤️🙏

    • @asutoshbikun
      @asutoshbikun 3 дня назад

      ​@@codestorywithMIKplease sir, try to post contest questions also.

    • @asutoshbikun
      @asutoshbikun 3 дня назад

      ​@@codestorywithMIK atleast last two questions

  • @FarhanKhan-bt6rb
    @FarhanKhan-bt6rb 3 дня назад

    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

    • @gui-codes
      @gui-codes 3 дня назад +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 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.

  • @ritikgupta1196
    @ritikgupta1196 3 дня назад

    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

  • @rickdutta942
    @rickdutta942 3 дня назад

    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.

    • @codestorywithMIK
      @codestorywithMIK  3 дня назад +1

      Please don’t think so.
      It happens to everyone ❤️

    • @rickdutta942
      @rickdutta942 3 дня назад +1

      @@codestorywithMIK Thanks Mik sir. Your motivational quote is my daily fuel.