You are viewing a single comment's thread. Return to all comments →
for C# my solution, if there is any improvements on this please do tell
public static int flippingMatrix(List<List<int>> matrix) { int sum = 0; for (int i = 0, len = matrix.Count - 1; i < (matrix.Count / 2); i++, len--) { for (int j = 0, k = matrix.Count - 1; j < (matrix.Count / 2); j++, k--) { int[] temp = [matrix[i][j], matrix[i][k], matrix[len][j], matrix[len][k]]; sum += temp.Max(); } } return sum; }
Seems like cookies are disabled on this browser, please enable them to open this website
Flipping the Matrix
You are viewing a single comment's thread. Return to all comments →
for C# my solution, if there is any improvements on this please do tell