4 replaced http://codegolf.stackexchange.com/ with https://codegolf.stackexchange.com/
source | link

C# (332)

This is my original program after excluding white spaces. Please pardon me if I did mistake in counting

using System;
using System.Collections.Generic;
using System.Linq;

class P
{        
    static void Main(String[] A)
    {           
        Dictionary<string,int> D=new Dictionary<string,int>();
        foreach(string s in A)
        {
            if(!D.ContainsKey(s))
                D.Add(s,1);
            else D[s]+= 1;
        }
        foreach(KeyValuePair<string,int> i in D.OrderByDescending(k=>k.Value))
            Console.WriteLine(i.Key+":" + i.Value);
    }
}

This is program with lots of character saving after suggestions from my dear friend jimbobmcgeejimbobmcgee

using System;
using System.Collections.Generic;
using System.Linq;

class P
{
    static void Main(string[] A)
    {        
       var D = new Dictionary<string, int>();
       foreach (var v in A)
       {
          if (!D.ContainsKey(v))
            D[v] = 1;
          else D[v] += 1;
       }
     foreach (var v in D.OrderBy(k=>-k.Value))
     {
        Console.WriteLine(v.Key+": "+v.Value);
     }
   }
}

Output

enter image description here

C# (332)

This is my original program after excluding white spaces. Please pardon me if I did mistake in counting

using System;
using System.Collections.Generic;
using System.Linq;

class P
{        
    static void Main(String[] A)
    {           
        Dictionary<string,int> D=new Dictionary<string,int>();
        foreach(string s in A)
        {
            if(!D.ContainsKey(s))
                D.Add(s,1);
            else D[s]+= 1;
        }
        foreach(KeyValuePair<string,int> i in D.OrderByDescending(k=>k.Value))
            Console.WriteLine(i.Key+":" + i.Value);
    }
}

This is program with lots of character saving after suggestions from my dear friend jimbobmcgee

using System;
using System.Collections.Generic;
using System.Linq;

class P
{
    static void Main(string[] A)
    {        
       var D = new Dictionary<string, int>();
       foreach (var v in A)
       {
          if (!D.ContainsKey(v))
            D[v] = 1;
          else D[v] += 1;
       }
     foreach (var v in D.OrderBy(k=>-k.Value))
     {
        Console.WriteLine(v.Key+": "+v.Value);
     }
   }
}

Output

enter image description here

C# (332)

This is my original program after excluding white spaces. Please pardon me if I did mistake in counting

using System;
using System.Collections.Generic;
using System.Linq;

class P
{        
    static void Main(String[] A)
    {           
        Dictionary<string,int> D=new Dictionary<string,int>();
        foreach(string s in A)
        {
            if(!D.ContainsKey(s))
                D.Add(s,1);
            else D[s]+= 1;
        }
        foreach(KeyValuePair<string,int> i in D.OrderByDescending(k=>k.Value))
            Console.WriteLine(i.Key+":" + i.Value);
    }
}

This is program with lots of character saving after suggestions from my dear friend jimbobmcgee

using System;
using System.Collections.Generic;
using System.Linq;

class P
{
    static void Main(string[] A)
    {        
       var D = new Dictionary<string, int>();
       foreach (var v in A)
       {
          if (!D.ContainsKey(v))
            D[v] = 1;
          else D[v] += 1;
       }
     foreach (var v in D.OrderBy(k=>-k.Value))
     {
        Console.WriteLine(v.Key+": "+v.Value);
     }
   }
}

Output

enter image description here

3 Characters reduction
source | link

C# (332)

These areThis is my original program after excluding white spaces. Please pardon me if I did mistake in counting

using System;
using System.Collections.Generic;
using System.Linq;

class P
{        
    static void Main(String[] A)
    {           
        Dictionary<string,int> D=new Dictionary<string,int>();
        foreach(string s in A)
        {
            if(!D.ContainsKey(s))
                D.Add(s,1);
            else D[s]+= 1;
        }
        foreach(KeyValuePair<string,int> i in D.OrderByDescending(k=>k.Value))
            Console.WriteLine(i.Key+":" + i.Value);
    }
}

This is program with lots of character saving after suggestions from my dear friend jimbobmcgee

using System;
using System.Collections.Generic;
using System.Linq;

class P
{
    static void Main(string[] A)
    {        
       var D = new Dictionary<string, int>();
       foreach (var v in A)
       {
          if (!D.ContainsKey(v))
            D[v] = 1;
          else D[v] += 1;
       }
     foreach (var v in D.OrderBy(k=>-k.Value))
     {
        Console.WriteLine(v.Key+": "+v.Value);
     }
   }
}

Output

enter image description here

C# (332)

These are excluding white spaces. Please pardon me if I did mistake in counting

using System;
using System.Collections.Generic;
using System.Linq;

class P
{        
    static void Main(String[] A)
    {           
        Dictionary<string,int> D=new Dictionary<string,int>();
        foreach(string s in A)
        {
            if(!D.ContainsKey(s))
                D.Add(s,1);
            else D[s]+= 1;
        }
        foreach(KeyValuePair<string,int> i in D.OrderByDescending(k=>k.Value))
            Console.WriteLine(i.Key+":" + i.Value);
    }
}

Output

enter image description here

C# (332)

This is my original program after excluding white spaces. Please pardon me if I did mistake in counting

using System;
using System.Collections.Generic;
using System.Linq;

class P
{        
    static void Main(String[] A)
    {           
        Dictionary<string,int> D=new Dictionary<string,int>();
        foreach(string s in A)
        {
            if(!D.ContainsKey(s))
                D.Add(s,1);
            else D[s]+= 1;
        }
        foreach(KeyValuePair<string,int> i in D.OrderByDescending(k=>k.Value))
            Console.WriteLine(i.Key+":" + i.Value);
    }
}

This is program with lots of character saving after suggestions from my dear friend jimbobmcgee

using System;
using System.Collections.Generic;
using System.Linq;

class P
{
    static void Main(string[] A)
    {        
       var D = new Dictionary<string, int>();
       foreach (var v in A)
       {
          if (!D.ContainsKey(v))
            D[v] = 1;
          else D[v] += 1;
       }
     foreach (var v in D.OrderBy(k=>-k.Value))
     {
        Console.WriteLine(v.Key+": "+v.Value);
     }
   }
}

Output

enter image description here

2 Counts
source | link

C# (340332)

PleaseThese are excluding white spaces. Please pardon me if I did mistake in counting

using System;
using System.Collections.Generic;
using System.Linq;

class P
{        
    static void Main(String[] A)
    {           
        Dictionary<string,int> D=new Dictionary<string,int>();
        foreach(string s in A)
        {
            if(!D.ContainsKey(s))
                D.Add(s,1);
            else D[s]+= 1;
        }
        foreach(KeyValuePair<string,int> i in D.OrderByDescending(k=>k.Value))
            Console.WriteLine(i.Key+":" + i.Value);
    }
}

Output

enter image description here

C# (340)

Please pardon me if I did mistake in counting

using System;
using System.Collections.Generic;
using System.Linq;

class P
{        
    static void Main(String[] A)
    {           
        Dictionary<string,int> D=new Dictionary<string,int>();
        foreach(string s in A)
        {
            if(!D.ContainsKey(s))
                D.Add(s,1);
            else D[s]+= 1;
        }
        foreach(KeyValuePair<string,int> i in D.OrderByDescending(k=>k.Value))
            Console.WriteLine(i.Key+":" + i.Value);
    }
}

Output

enter image description here

C# (332)

These are excluding white spaces. Please pardon me if I did mistake in counting

using System;
using System.Collections.Generic;
using System.Linq;

class P
{        
    static void Main(String[] A)
    {           
        Dictionary<string,int> D=new Dictionary<string,int>();
        foreach(string s in A)
        {
            if(!D.ContainsKey(s))
                D.Add(s,1);
            else D[s]+= 1;
        }
        foreach(KeyValuePair<string,int> i in D.OrderByDescending(k=>k.Value))
            Console.WriteLine(i.Key+":" + i.Value);
    }
}

Output

enter image description here

1
source | link