Exemplo n.º 1
0
        public void Solution1Test()
        {
            string[]         strs1 = new string[] { "ac", "ac", "a", "a" };
            string[]         strs2 = new string[] { "hello" };
            string[]         strs3 = new string[] { "dog", "racecar", "car" };
            LongestCommonPre lcp   = new LongestCommonPre();

            Assert.AreEqual("a", lcp.Solution1(strs1));
            //Assert.AreEqual("hello", lcp.Solution1(strs1));
            //Assert.AreEqual("", lcp.Solution1(strs1));
        }
        public void CheckValidOutputExample1()
        {
            //Arrange
            var lcp   = new LongestCommonPre();
            var input = BuildInput1();

            var exep = "fl";

            //Act
            var output = lcp.LongestCommonPrefix(input);

            //Assert
            Assert.Equal(exep, output);
        }