如何操作双极板材料四探针低阻测试仪?
2026/1/16 16:02:24
Problem: 867. Transpose Matrix 转置矩阵
耗时100%,矩阵转置的,行索引变列索引,列索引变行索引
class Solution { public: vector<vector<int>> transpose(vector<vector<int>>& matrix) { int m = matrix.size(), n = matrix[0].size(); vector<vector<int>> ret(n, vector<int>(m)); for(int i = 0; i < m; i++) { for(int j = 0; j < n; j++) { ret[j][i] = matrix[i][j]; } } return ret; } };