Exemplo n.º 1
0
        static void RunSherlockAndAnagrams()
        {
            var queriesAmount    = Convert.ToInt32(Console.ReadLine());
            var dictionaryWorker = new DictionaryWorker();

            for (var i = 0; i < queriesAmount; i++)
            {
                var input = Console.ReadLine();

                int result = dictionaryWorker.CountAnagramsInString(input);

                Console.WriteLine(result);
            }
        }
Exemplo n.º 2
0
        static void RunHashTablesRansomNote()
        {
            string[] input = Console.ReadLine().Split(' ');

            var magazineLength = Convert.ToInt32(input[0]);

            var noteLength = Convert.ToInt32(input[1]);

            string[] magazine = Console.ReadLine().Split(' ');

            string[] note = Console.ReadLine().Split(' ');

            var dictionaryWorker = new DictionaryWorker();

            Console.WriteLine(dictionaryWorker.CheckMagazine(magazine, note));
        }
Exemplo n.º 3
0
        static void RunTwoStrings()
        {
            var testsAmount      = Convert.ToInt32(Console.ReadLine());
            var dictionaryWorker = new DictionaryWorker();

            for (var i = 0; i < testsAmount; i++)
            {
                var firstString = Console.ReadLine();

                var secondString = Console.ReadLine();

                string result = dictionaryWorker.CheckIfStringsHaveCommonSubstring(firstString, secondString);

                Console.WriteLine(result);
            }
        }