コード例 #1
0
        public void MinWindowTest_TWithDuplicate()
        {
            var solution = new _076_MinimumWindowSubstring();

            var result = solution.MinWindow("ADOBECODEBANC", "ABCA");
            Assert.AreEqual("ADOBECODEBA", result);

            result = solution.MinWindow("ADOBECODEBANC", "ABCC");
            Assert.AreEqual("CODEBANC", result);
        }
コード例 #2
0
        public void MinWindowTest_TWithDuplicate()
        {
            var solution = new _076_MinimumWindowSubstring();

            var result = solution.MinWindow("ADOBECODEBANC", "ABCA");

            Assert.AreEqual("ADOBECODEBA", result);

            result = solution.MinWindow("ADOBECODEBANC", "ABCC");
            Assert.AreEqual("CODEBANC", result);
        }
コード例 #3
0
        public void MinWindowTest_TLongerThanS()
        {
            var solution = new _076_MinimumWindowSubstring();
            var result = solution.MinWindow("AD", "ABC");

            Assert.AreEqual("", result);
        }
コード例 #4
0
        public void MinWindowTest_SingleCharacterT()
        {
            var solution = new _076_MinimumWindowSubstring();
            var result = solution.MinWindow("ADOBECODEBANC", "A");

            Assert.AreEqual("A", result);
        }
コード例 #5
0
        public void MinWindowTest_NotContains_Partial()
        {
            var solution = new _076_MinimumWindowSubstring();
            var result = solution.MinWindow("ADOBECODEBANC", "ABX");

            Assert.AreEqual("", result);
        }
コード例 #6
0
        public void MinWindowTest_EmptyT()
        {
            var solution = new _076_MinimumWindowSubstring();
            var result = solution.MinWindow("ADOBECODEBANC", "");

            Assert.AreEqual("", result);
        }
コード例 #7
0
        public void MinWindowTest()
        {
            var solution = new _076_MinimumWindowSubstring();
            var result   = solution.MinWindow("ADOBECODEBANC", "ABC");

            Assert.AreEqual("BANC", result);
        }
コード例 #8
0
        public void MinWindowTest_NotContains_Partial()
        {
            var solution = new _076_MinimumWindowSubstring();
            var result   = solution.MinWindow("ADOBECODEBANC", "ABX");

            Assert.AreEqual("", result);
        }
コード例 #9
0
        public void MinWindowTest_TLongerThanS()
        {
            var solution = new _076_MinimumWindowSubstring();
            var result   = solution.MinWindow("AD", "ABC");

            Assert.AreEqual("", result);
        }