using System.Text.RegularExpressions;
using System.Collections.Generic;
public static void Main()
Console.WriteLine(HighestOccuringWord("This is really really great great great "));
public static string HighestOccuringWord(string str)
string[] strArray = Regex.Split(str, @"\s+");
Dictionary<String, int> dict = new Dictionary<String, int>();
string maxWord = strArray[0];
for (int i = 0; i < strArray.Length; i++)
if (!dict.ContainsKey(strArray[i]))
dict.Add(strArray[i], 0);
if (dict[strArray[i]] > count)
count = dict[strArray[i]];
if (dict[strArray[i]] > count)
count = dict[strArray[i]];