Q:

Sorting a List of Lists by the amount of intergers of the same type they contain

Hey everyone I have a list of lists which I am trying to sort based on how many of the same type of int it contains. Each item in the list of list contains 4 ints, for ex:
[0,1,2,3]
[0,1,1,1]
[0,2,2,2] etc. Im trying to sort the lists based on which contains the most of a specific int. So if I wanted to sort these three the [0,1,1,1] list would be on top since it contains three 1's etc. I was told to use linq to do this, but didnt know how to use linq.orderby with a method. Can someone help me if there is the correct approach? Thanks!
public class EnemyAI : MonoBehaviour
{
    List<List<int>> listOfPaths = new List<List<int>>();

    public void sortListofLists ()
    {
        listOfPaths.OrderBy(runeList => runeList.customMethod(runeType)); //rune type is an int
    }

    public int customMethod(int sort)
    {
        int holder = 0;
        for (int i = 0; i < MethodList.Count; i++)
        {
            if (MethodList[i] == sort)
            {
                holder++;
            }
        }
        return holder;

}

A:

Your problem can be separated into two sub-problems.
1. How to get the count of the most frequent integer in List?
You can use the following LINQ query:
int countOfMostOccurences = arr.GroupBy(x => x).Max(x => x.Count()); 

2. How to sort a List by a certain rule in descending order:
list = list.SortByDescending(x => rule);

Now, combine it:
List<List<int>> lists = new List<List<int>>
{
    new List<int> { 1, 2, 3, 4 },
    new List<int> { 1, 3, 3, 3 },
    new List<int> { 1, 2, 2, 3 },
    new List<int> { 1, 1, 1, 1 }
};

lists = lists.OrderByDescending(x => x.GroupBy(g => g).Max(g => g.Count())).ToList();

A:

Just order descending by count of particular digits:
var list = new List<List<int>>() 
{ 
    new List<int> { 0, 1, 2, 3 }, 
    new List<int> { 0, 1, 1, 1 }, 
    new List<int> { 0, 2, 2, 2 } 
};

var result = list.OrderByDescending(c => c.Count(y => y == 1)).ToList();

