You are viewing a single comment's thread. Return to all comments →
static string gridChallenge(List grid) { for (int i = 0; i < grid.Count; i++) { char[] caracteres = grid[i].ToCharArray();
for (int j = 0; j < caracteres.Length - 1; j++) { for (int k = 0; k < caracteres.Length - 1 - j; k++) { if (caracteres[k] > caracteres[k + 1]) { char temp = caracteres[k]; caracteres[k] = caracteres[k + 1]; caracteres[k + 1] = temp; } } } grid[i] = new string(caracteres); } for (int i = 0; i < grid.Count - 1; i++) { for (int j = 0; j < grid[i].Length; j++) { if (grid[i][j] > grid[i + 1][j]) { return "NO"; } } } return "YES";
}
Seems like cookies are disabled on this browser, please enable them to open this website
Grid Challenge
You are viewing a single comment's thread. Return to all comments →
static string gridChallenge(List grid) { for (int i = 0; i < grid.Count; i++) { char[] caracteres = grid[i].ToCharArray();
}