Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Added: Dec 13, 2020 5:25 PM
Views: 3
Tags: twodimarray
  1.  int rows = a.length;
  2.         int cols = a[0].length;
  3.        
  4.         var ar = new int[rows];
  5.  
  6.         for (int i = 0; i < rows; i++) {
  7.             for (int j = 0; j < cols; j++) {
  8.                 ar[i] += a[i][j];
  9.             }
  10.         }
  11.         return ar;
  12.     }