LeetCode 311 - Sparse Matrix Multiplication

แชร์
ฝัง
  • เผยแพร่เมื่อ 15 ก.ย. 2024
  • LeetCode 311 Sparse Matrix -
    LeetCode Link - leetcode.com/p...

ความคิดเห็น • 14

  • @vinaymanchundiya7480
    @vinaymanchundiya7480 3 ปีที่แล้ว +3

    Thanks for this explanation. Essential computation is done in the most inner step, which means you can change the order of the loops and it should still give you same result.
    Based on that, you only need to execute the loop if the value is non-zero.
    Here is the code for that. Thanks again for the simplified explanation.
    public int[][] multiply(int[][] mat1, int[][] mat2) {
    int m1r = mat1.length;
    int m2r = mat2.length;
    int m1c = m2r;
    int m2c = mat2[0].length;
    int[][] res = new int[m1r][m2c];
    for(int i=0; i

    • @nuravrai-ms5ee
      @nuravrai-ms5ee  2 ปีที่แล้ว

      thank you so much for understanding what I was saying in the video.

  • @CDJohnson
    @CDJohnson 4 ปีที่แล้ว +1

    This was really clear! Please add the followup

  • @snehar.3654
    @snehar.3654 3 ปีที่แล้ว +1

    I think you did well, very clear :)

  • @temuulenerdenebulgan7117
    @temuulenerdenebulgan7117 2 ปีที่แล้ว

    Thanks brother! Keep it up

  • @RudraprasadMohapatraa
    @RudraprasadMohapatraa ปีที่แล้ว

    Understood.

  • @apurvtaneja
    @apurvtaneja 4 ปีที่แล้ว +3

    Sparse Matrix. Look that up.

    • @varunraisinghani1769
      @varunraisinghani1769 3 ปีที่แล้ว

      Do you have a video of your solution?

    • @dARKf3n1Xx
      @dARKf3n1Xx ปีที่แล้ว

      like l0l that's the whole point of the problem... yale method is weird tho

  • @giovannidurante4134
    @giovannidurante4134 ปีที่แล้ว

    there is no sparse matrix optimization. Change the title since to does not match the content.

    • @nuravrai-ms5ee
      @nuravrai-ms5ee  ปีที่แล้ว

      You literally have no subscribers - go do something more useful troll

    • @giovannidurante4134
      @giovannidurante4134 ปีที่แล้ว

      @@nuravrai-ms5ee like i cared about my subscribers man😂

  • @SivaBhargavRavella
    @SivaBhargavRavella 3 ปีที่แล้ว

    very confusing explanation

    • @nuravrai-ms5ee
      @nuravrai-ms5ee  2 ปีที่แล้ว

      Hi siva, did you try the solution in leetcode and understand how the solution works ?