Find largest binary gap of a number N
If you're just looking for the longest stretch of zeros you don't need to use a list at all. You just iterate through the binary representation until you find a stretch of zeros. If you hit a new high score, you can overwrite the old high score with the new one and keep moving forward, forgetting about the past.

This is called a "greedy algorithm."

    public static int FindGap(int number)
    {
        string binaryRep = Convert.ToString(number, 2);

        int maxGapSize = 0;
        int currGapSize = 0;

        foreach(char ch in binaryRep)
        {
            if (ch == '0')
            {
                currGapSize++;
            }
            else
            {
                maxGapSize = Math.Max(currGapSize, maxGapSize);
                currGapSize = 0;
            }
        }

        return maxGapSize;
    }


If you want to get really fancy, you don't even need to convert the number to a string. You can use bit shifts to "iterate" through the bits in the number. The number 9 is 1001 in binary. Shift the bits over one, and you've got 100. Shift it over again, and you've got 10. You can use modulus operations to see if the least significant digit is 0 or 1. 

This is just a fancy way to repeatedly divide by 2. In fact, you could solve this problem by dividing by 2 instead but this way works as well. (There's also probably a more terse way to write this, but this is perfectly efficient.)

    public static int FindGap2(int number)
    {
        int maxGapSize = 0;
        int currGapSize = 0;

        if (number == 0)
            return 0;

        while (number % 2 == 0)
            number = number &gt;&gt; 1;

        while (number &gt; 0)
        {
            if(number%2 == 0)
            {
                currGapSize++;
            }
            else
            {
                maxGapSize = Math.Max(currGapSize, maxGapSize);
                currGapSize = 0;
            }
            number = number &gt;&gt; 1;
        }

        return maxGapSize;
    }