(List<List<String>> matrix, int index)
| 130 | } |
| 131 | |
| 132 | public static List<String> getColumn(List<List<String>> matrix, int index) { |
| 133 | |
| 134 | List<String> getColumn = new ArrayList<>(); |
| 135 | for (List<String> row : matrix) { |
| 136 | if (!row.isEmpty()) { // 确保至少有一个元素 |
| 137 | getColumn.add(row.get(index)); // 添加第一列的元素 |
| 138 | } |
| 139 | } |
| 140 | return getColumn; |
| 141 | } |
| 142 | } |
no outgoing calls
no test coverage detected