Ejemplo n.º 1
0
        public void Test3()
        {
            var(item1, item2) = AlgorithmUtility.Run <int, string>(InputFilePath("input06.txt"));
            var result = RunTest(() => SherlockAndAnagrams.sherlockAndAnagrams(item2[0][0])).Item1;

            Assert.Equal(5, result);
        }
Ejemplo n.º 2
0
        public void Test3()
        {
            var(item1, item2) = AlgorithmUtility.Run <int, string>(InputFilePath("input21.txt"));
            var result = RunTest(() => RansomeNote.checkMagazine(item2[0].ToArray(), item2[1].ToArray()));

            Assert.Equal("No", result.Item1);
        }
        public void Test2()
        {
            var(item1, item2) = AlgorithmUtility.Run <long, long>(InputFilePath("input2.txt"));
            var result = RunTest(() => CountTriplets.countTriplets(item2[0], item1[1])).Item1;

            Assert.Equal(4, result);
        }
Ejemplo n.º 4
0
 public void Test1()
 {
     var(item1, item2) = AlgorithmUtility.Run <int, int>(InputFilePath("input.txt"));
     var(result, time) = RunTest(() => BubbleSort.countSwaps(item2[0].ToArray()));
     Assert.Equal("Array is sorted in 3 swaps.", $"Array is sorted in {result.Item1} swaps.");
     Assert.Equal("First Element: 1", $"First Element: { result.Item2}");
     Assert.Equal("Last Element: 3", $"Last Element: {result.Item3}");
 }
Ejemplo n.º 5
0
        public void Test2()
        {
            var(item1, item2) = AlgorithmUtility.Run <int, string>(InputFilePath("input01.txt"));
            var result = new List <int>();

            for (var i = 0; i < item1[0]; i++)
            {
                result.Add(RunTest(() => SherlockAndAnagrams.sherlockAndAnagrams(item2[i][0])).Item1);
            }
            Assert.Equal(3, result[0]);
            Assert.Equal(10, result[1]);
        }
Ejemplo n.º 6
0
        public void TestNaive()
        {
            var(item1, item2) = AlgorithmUtility.Run <int, string>(InputFilePath("input.txt"));
            var result = new List <string>();

            for (var i = 0; i < item2.Count - 1; i += 2)
            {
                result.Add(RunTest(() => TwoStrings.twoStringsNaive(item2[i][0], item2[i + 1][0])).Item1);
            }
            Assert.Equal("YES", result[0]);
            Assert.Equal("NO", result[1]);
        }
 public void Test2()
 {
     var(item1, item2) = AlgorithmUtility.Run <int, int>(InputFilePath("input2.txt"));
     var(result, time) = RunTest(() => MarkAndToys.maximumToys(item2[0].ToArray(), item1[1]));
     Assert.Equal(3, result);
 }
Ejemplo n.º 8
0
 public void TestNaive()
 {
     var(item1, item2) = AlgorithmUtility.Run <int, int>(InputFilePath("test_case_12.txt"));
     RunTest(() => ArrayManipulation.arrayManipulationNaive(item1[0], item2.Select(x => x.ToArray()).ToArray()));
 }