Sort by

recency

|

8 Discussions

|

  • + 0 comments

    Java:

    public class Solution {
        public static void main(String[] args) {
            int[][] M = {{1, 2, 3}, {2, 3, 4}, {1, 1, 1}};
            int[][] N = {{4, 5, 6}, {7, 8, 9}, {4, 5, 0}};
                    
            for (int i = 0; i < M.length; i++) {
              for (int j = 0; j < M[i].length; j++) {
                System.out.println(M[i][j] - N[i][j]);
              }
            }
        }
    }
    
  • + 0 comments
    a1 = [1,2,3]
    a2 = [2,3,4]
    a3 = [1,1,1]
    
    matrix_a = [a1,a2,a3]
    
    b1 = [4,5,6]
    b2 = [7,8,9]
    b3 = [4,5,0]
    
    matrix_b = [b1,b2,b3]
    
    c1 = []
    c2 = []
    c3 = []
    
    matrix_c = [c1,c2,c3]
    
    
    
    for n in range(len(matrix_a)):
      for i in range(len(matrix_a[n])):
        matrix_c[n].append(matrix_a[n][i] - matrix_b[n][i])
    
    
    
    for n in range(len(matrix_c)):
      for i in range(len(matrix_c[n])):
        print(matrix_c[n][i])
    
  • + 0 comments
    -3
    -3
    -3
    -5
    -5
    -5
    -3
    -4
    1
    
  • + 0 comments
    -3
    -3
    -3
    -5
    -5
    -5
    -3
    -4
    1
    

    -3 -3 -5 -5 -5 -3 -4 1

  • + 1 comment

    what exactly we have to do here is not clear