using System.Collections.Generic;
public static void Main()
object[] values = {1,2, "Hello", new List<int>(){1,2,3,4}, "John"};
int answer = GetTypeCount(values, input);
Console.WriteLine("Answer: {0}" ,answer);
public static int GetTypeCount(object[] obj, object type)
Dictionary<Type,int> results = new Dictionary<Type,int>();
foreach(object item in obj)
Type itemType = item.GetType();
if(!results.ContainsKey(itemType))
return results[type.GetType()];