String compression by using repeated characters count My task was to perform a basic string compression by replacing consecutive repeated characters by one instance of the character and integer denoting the number of repetitions. 
For example the string "aaaaabbcccdeee" should be reduced to "a5b2c3de3".
I have tried working in C# using a simple logic. Please see the below code. Also I have added the condition to not to add the count 1 in the compressed string if there is only single letter occurrence. E.g. if letter "d" is occurred only once in a string "aaabbcccdee" then function will give a compressed string as "a3b2c3de2" and not the "a3b2c3d1e2". To modify this requirement we can change the condition for this single count. 
Please let me know about the comparative time and space complexity and other efficient way in C#.

class StringCompression
{
    static void Main(string[] args)
    {
        StringCompression sc = new StringCompression();

        sc.CompressionMethod("aaaaabbbccdeeeee");
        sc.CompressionMethod("aaabbccdddee");
        sc.CompressionMethod("a");
    }

    public void CompressionMethod(string originalString)
    {
        List&lt;char&gt; OriginalList = new List&lt;char&gt;();
        List&lt;string&gt; CompressedList = new List&lt;string&gt;();
        OriginalList.AddRange(originalString);
        // Convert to Character Array
        char[] charArray = OriginalList.ToArray();

        int i = 0;
        char character;
        int len = charArray.Length;

        while (i &lt; len)
        {
            int n = 0;
            character = (charArray[i]);
            while (i &lt; charArray.Length &amp;&amp; charArray[i] == character)
            {
                n = n + 1;
                i++;
            }

            // add characters to the new list 
            CompressedList.Add(character.ToString());

            // add character counts to the new list 
            if (n == 1)
            {
                // Do nothing
            }
            else
            {
                CompressedList.Add(n.ToString());
            }
        }
        // CompressedList will contain compressed string
        foreach (string str in CompressedList)
        {
            Console.Write(str);
        }
        Console.Write("\n");
        Console.Write("\n");
    }
}
String as an Array

You got your string parameter:

string originalString


Then you turned it into a list:

OriginalList.AddRange(originalString);


Then you turned it into an array:

charArray = OriginalList.ToArray();


And finally used it as:

character = (charArray[i]);


Instead of all that, you could have just done this:

character = (originalString[i]);


Class Design

Instantiating a StringCompression class every time you wanna compress a string can be avoided by just declaring the function CompressionMethod as static since the class has no members anyway. So in Main, you only have to do:

StringCompression.CompressionMethod("String here");


Or better: make it an extension method.

String Builder

Instead of a list of strings in:

CompressedList = new List&lt;string&gt;();


You could instead use a String Builder to create the resulting string.