using System.Collections;
using System.Collections.Generic;
public static void fiddle(string str, int k){
if(str.Length < k) Console.WriteLine("The input substring is larger than the length of the string");
Dictionary<string, int> hash = new Dictionary<string, int>();
for (int i = 0; i<=(str.Length - k); i++){
string sub = str.Substring(i, k);
if (hash.ContainsKey(sub)){
foreach (KeyValuePair<string, int> keyVal in hash){
Console.WriteLine("string = {0}, occurance = {1}", keyVal.Key, keyVal.Value);
public static void Main()
Console.WriteLine("Submission for Nikki Motevaselolhagh");
fiddle("123222564===85123===", 1);