I’m trying to sort a two dimensional array and I’m having a problem with the Unity syntax (or something).
I took this example from online and I thought it should work but I get an error in Unity.
int[,] array = new int[3, 3] { { 1, 4, 2 }, { 4, 5, 1 }, { 7, 3, 8 } };
int[,] sortedByFirstElement = array.OrderBy(x => x[0]);
int[,] sortedBySecondElement = array.OrderBy(x => x[1]);
int[,] sortedByThirdElement = array.OrderBy(x => x[2]);
When I run it I get error message CS0411 which says: “…Try specifying the type arguments explicitly”
How do I need to modify/change this so I can get it to work in Unity?
Thank you in advance.