Here you can find the source of sumAllColumnsOfMatrix(List> matrix)
public static List<Integer> sumAllColumnsOfMatrix(List<List<Integer>> matrix)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; import java.util.List; public class Main { public static List<Integer> sumAllColumnsOfMatrix(List<List<Integer>> matrix) { List<Integer> result = new ArrayList<Integer>(); for (int i = 0; i < matrix.size(); i++) { Integer columnTotal = 0; for (int j = 0; j < matrix.size(); j++) // loop over all columns of matrix {/*www .j a v a 2 s . c o m*/ List<Integer> row = matrix.get(j); for (int k = 0; k < row.size(); k++) // loop over all rows of matrix { if (k == i) { columnTotal = (columnTotal + row.get(k)) % 26; break; } } } result.add(columnTotal); } return result; } }