using System.Collections.Generic;
public class ScoreLookup {
Dictionary<string, int> dictionary = new Dictionary<string, int>();
public void AddScore(string name, int score) {
dictionary.Add(name,score);
public int LookupScore(string name) {
if (dictionary.ContainsKey(name)){
int value = dictionary[name];
foreach(KeyValuePair<string, int> pair in dictionary){
string[] words = pair.Key.Split();
for (int i = 0; i<words.Length; i++){
public static void Main()
ScoreLookup lookup = new ScoreLookup();
lookup.AddScore("John Chan", 55);
lookup.AddScore("Henry Wong", 0);
lookup.AddScore("Mary Lee", 60);
lookup.AddScore("Hillary Clinton", 99);
lookup.AddScore("Pikachu", 100);
Console.WriteLine(lookup.LookupScore("John"));
Console.WriteLine(lookup.LookupScore("Mary Lee"));
Console.WriteLine(lookup.LookupScore("Pikachu"));
Console.WriteLine(lookup.LookupScore("Wong"));
Console.WriteLine(lookup.LookupScore("Hillary"));